打印

[asp] 求助:一个关于记录排序的问题

数据库字段:
ID
Province(省份)
Usernames(用户名)

要实现的效果:
[北京] 用户名1 用户名2 用户名3 用户名4 ......
[上海] 用户名5 用户名6 用户名7 用户名8 ......
[江苏] 用户名9 用户名10 用户名11 用户名12 ......

当新加一个用户时,该用户所在的省份就排到第一行,而该用户名就在省份名后面的第一项
比如新加一个福建的用户 FJ,则显示如下:
[福建] FJ 用户名X 用户名Y 用户名Z......
[北京] 用户名1 用户名2 用户名3 用户名4 ......
[上海] 用户名5 用户名6 用户名7 用户名8 ......
[江苏] 用户名9 用户名10 用户名11 用户名12 ......

请问这个要怎么写代码啊?
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<%
sql = "select * from [user] where id in (select Max(id) from [user] group by province) order by id desc"
set nRs=conn.execute(sql)
for i=1 to 12
if not nRs.eof then
%>
  <tr>
       <td align="left" style="line-height:17px"><a href="#">[<%=nRs("province")%>]</a>
       <%
       sql2 = " select * from [user] where 1=1 "
       sql2 = sql2 & " and province='"&nRs("province")&"' "
       sql2 = sql2 & " order by id desc "
       set oRs=conn.execute(sql2)
       for j=1 to 4
       if not oRs.eof then
       %>
       <span style=" padding-left:1px;"><%=oRs("username")%></span>
       <%
       oRs.movenext
       end if
       next
       oRs.close
       %>
       </span></td>
  </tr>
<%
nRs.movenext
end if
next
nRs.close
%>
</table>