Friday 18 May 2007

Selecting Nth row from SQL Server 2000 table

Scritpt bellow explain how to get Nth row from SQL Server 2000 table


SELECT * FROM
(
SELECT *, (SELECT COUNT(*) FROM MyTable t2 WHERE t2.ID<=t1.ID) rn FROM MyTable t1
) x WHERE rn%5=1



where 5 is the column number

1 comment:

Anonymous said...

top [url=http://www.001casino.com/]free casino[/url] coincide the latest [url=http://www.casinolasvegass.com/]casino las vegas[/url] autonomous no set aside bonus at the leading [url=http://www.baywatchcasino.com/]casino games
[/url].