View Single Post
  #9 (permalink)  
Old June 7th, 2006, 04:36 PM
robprell robprell is offline
Friend of Wrox
Points: 807, Level: 11
Points: 807, Level: 11 Points: 807, Level: 11 Points: 807, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: Orange County, CA, USA.
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am not sure why you would want to combine the two. But I recall I once came up with an obscure need for this. I created a column called RS for result set. Set the value to one for the first result set, to two for the second. added the two result sets together increasing the columns. For example say I do the following two selects.

Select firstname, lastname from x
Select city, state from y

the result set would come out like this.....

rs FirstName LastName City State
1 John doe
1 Susan Smith
1 Pewee Herman
1 Dubya Bush
2 Hollywood CA
2 New York NY
2 Oklahoma City OK
2 Seattle WA



Notice for RS = 1 there are not city or state values, and for RS = 2
there are no names.

You can do this with a temp table probably easiest.

Hope this helps,
Rob

Reply With Quote