On 2/4/2013 8:34 PM, Igor Tandetnik wrote:
On 2/4/2013 8:22 PM, YAN HONG YE wrote:
I hava a table like this:
id,name,score,rank
1,anna,80,0
2,qera,65,0
6,kero,90,0
10,rosa,95,0

what I would like to do is to update the rank position.

update mytable set rank = (select count(*) from mytable t2 where
t2.score <= mytable.score);

Sorry, that should be        t2.score >= mytable.score

--
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to