View Single Post
  #4 (permalink)  
Old October 31st, 2005, 09:20 PM
Jeff Mason Jeff Mason is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: Hudson, MA, USA.
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by robprell
 you can't do order by on union commands ...
Sure you can.

The ORDER BY simply applies to the combined results of all the queries comprising the UNION operator. The ORDER BY cannot be applied to each constituent query, since that would make no sense. But it makes perfect sense to order the combined result.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
Reply With Quote