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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Select newbie question

Status
Not open for further replies.

Indrawati

Programmer
Joined
Mar 28, 2004
Messages
2
Location
SG
Hi

I currently have a database which contains 3000 records. What I want to do is, I want to extract only 2500 records out of this 3000. I know I can select the top 2500 with SQL SELECT TOP statement, but is there a way for me to select, let's say records 1-500 and 1001-3000?
Thanks!
 
Create a union query where the first select is a TOP 500 while sorting ascending. The second select sorts descending and selects TOP 2000.

Give this a try and I think it should work for you.


[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top