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

Easy Union Question 2

Status
Not open for further replies.

GRHE

Programmer
Jun 19, 2001
29
0
0
GB
I have a group of four selects all union'd. Is there a way of getting the top 1000 of "all of the results". I have tried top 1000 in each of the selects but that returns 4,000??

It's Friday and I want to go hom :)
 
Code:
SELECT TOP 1000 FROM
  (
  SELECT * FROM t1
  UNION
  SELECT * FROM t2
  UNION
  SELECT * FROM t3
  UNION
  SELECT * FROM t4
  )
ORDER BY col1

--James
 
Cheers I can go to the pub now :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top