Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

limit command

Status
Not open for further replies.

teroy

Programmer
Oct 17, 2000
67
AU
Hi there,
If i do a sql query that returned 25 rows
say select * from customer

how do i get rows 10 to 20?

I use another dbase called postgreSQL and the way it does it is

select * from customer limit 10,10

wheras the first 10 is how many rows you want returned and the 2nd 10 is where you want it to start

I'm sure sql server has an equivalent but i'm not sure of the syntax

Much help appreciated
 
There are several work arounds, including:

* clever use of ORDER BY and TOP (though it may not help in a particular situation)

* using a cursor

* if the rows have a numeric sequential key, select a range based on that. Robert Bradley
teaser.jpg

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top