Hey Igor, thanks for the reply.

Is this O(1) ?

Ian

On 09/09/2011 13:21, Igor Tandetnik wrote:
Ian Hardingham<i...@omroth.com>  wrote:
Again, I have:

eloResultTable (id INTEGER PRIMARY KEY AUTOINCREMENT, player TEXT, elo
FLOAT)

with:

CREATE INDEX IF NOT EXISTS eloResultScore ON eloResultTable (elo DESC)

If I have the id of a row in eloResultTable, I wish to find how far down
the eloResultScore index it is (I basically want to find a player's rank
when ordered by elo).  Is there a way to do this?
select count(*) from eloResultTable where elo>=
     (select elo from eloResultTable where id = ?);


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

Reply via email to