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!

Limiting rows

Status
Not open for further replies.

Luk1

Programmer
Joined
Apr 14, 2003
Messages
2
Location
BG
I'm trying to figure a way to combine these 3 queries into a single one.

select top 48 * from table1 where column1 = 1
select top 48 * from table1 where column1 = 2
select top 48 * from table1 where column1 = 3

Anybody know of a way that would make it possible?

 
The UNION operator can be used between queries to combine their results into a single result set.
 
To elaborate what stsuing has said:

select top 48 * from table1 where column1 = 1
UNION
select top 48 * from table1 where column1 = 2
UNION
select top 48 * from table1 where column1 = 3


Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top