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
 General SQL Server Forums
 New to SQL Server Programming
 Retrieve specific rows

Author  Topic 

basicconfiguration
Constraint Violating Yak Guru

358 Posts

Posted - 2008-12-09 : 18:10:45
Does anyone know how to select rows from 10000 to 10005?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-09 : 18:14:54
WHERE RowId BETWEEN 10000 AND 10005

If you have a more specific question, please let us know.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

basicconfiguration
Constraint Violating Yak Guru

358 Posts

Posted - 2008-12-09 : 18:18:04
Between doesn't work with uniqueindentifier type.

I got the answer


SELECT * FROM
(
SELECT Row_Number() OVER (ORDER BY clientID) as rowid, *
FROM client.client
) as a
where rowid between 2 and 3

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-09 : 18:24:37
You didn't tell us it was a GUID.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -