TClevel
asked on
T-SQL Union
how can I union a statment like this to get a result like the bottom output
select a, b, c, count(*) As cars from table1
group by a
UNION
select a, b, c, Count(*) AS houses from table2
group by a
I like the output to look something like this
a b c Cars Houses
--- ---- --- ------ ----------
john Brown car 2 2
Kim Joins car 3 3
select a, b, c, count(*) As cars from table1
group by a
UNION
select a, b, c, Count(*) AS houses from table2
group by a
I like the output to look something like this
a b c Cars Houses
--- ---- --- ------ ----------
john Brown car 2 2
Kim Joins car 3 3
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank You
Welcome
Open in new window
Raj