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

Merge with an UNION

Status
Not open for further replies.

SebFr

Programmer
May 28, 2006
12
US
Hi,

I've two separated queries that both return two columns: the first one returns NAMES | #ORDERS, and the second one NAMES | #SALES

I would like to merge those two queries to one query with the columns like that: NAME | #ORDERS | #SALES.
I tried to add the missing column on each query with a value to 0 and then make an UNION between the two queries but I get 2 rows for each name: NAME | 0 | #SALES and NAME | #ORDERS | 0. I want to merge that to get only one row per name.

Can anyone tell me how to do that please? Hope I was clear enough...

Thanks
 
Thanks Leslie.
Exactly what I wanted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top