Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
returning the number of a row?
ok here's my problem:
i need to write some sql code for a game ranking.
there are pretty many ppl in it so it has to be fast
tried to move within ADO to the startrow and then select as many as i need per page but this is taking too long
for i=1 to pagesize
so is there any way within TSQL to determine the position of a row from within an sql statment
e.g. select @@row_position, * from ranking ?
or any similar solution you may think of? of course i could use a temporary table but this would be slow again, as far as i'm concearned
my current approach is fast but doesn't work with equal ranking scores:
select top pagesize from ranking where score > (select top pagesize*(page-1)+1 scores from ranking)
help would be appriciated,