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 = ?);

-- 
Igor Tandetnik

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

Reply via email to