如何更新排行榜?
我碰到一个问题。
我想根据表[abc]中的字段[aaa]的排序来更新字段[bbb]的数据。
id aaa bbb
75 732 1 ←如何更新字段bbb这样?
22 372 2
93 277 3
12 86 4
.. .. ..
看我写的,哪里出了问题。谢谢!
top=1
set rs= conn.execute("select * from [abc] order by aaa desc")
if rs.eof then
call error()
else
do while not rs.eof
id=rs("id")
response.write "<b>"&top&"</b>"
conn.execute("update [aaa] set bbb="&top&" where ID="&id&"")
top=top+1
rs.movenext
loop
end if