Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 the equivalent of limit in sql 2005

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2009-03-11 : 07:48:03
in my sql you can take a recordset and do limit 10,10
to show from the 10th to the 20th record

is there anyway to do this in sql server?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-03-11 : 07:49:57
It's called paging and there are many many topic here at SQLTeam about that.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-11 : 14:00:49
one method is to use rownumber function. something like

SELECT columns...
FROM
(SELECT ROW_NUMBER() OVER (ORDER BY PK) AS Seq,other columns
FROM Table
)t
WHERE Seq BETWEEN 10 AND 20

pk is primary key
Go to Top of Page

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2009-03-11 : 14:06:40
thanks i found it online - very useful
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-11 : 14:14:58
welcome
Go to Top of Page
   

- Advertisement -