I have two queries to get data and I want to show both of them in the same table:
select aaa.Text, count(*)
from XXXXX main inner join XXXXXX
on XXXXX
where status = A
group XXXXX
order by aaa.Text
Text1 111111
Text2 222222
Text3 333333
select aaa.Text, count(*)
from XXXXX main inner join XXXXXX
on XXXXX
where status = B
group XXXXX
order by aaa.Text
Text1 444444
Text2 555555
Text3 666666
And I just want to show the data in the same table with two columns
Text1 111111 444444
Text2 222222 555555
Text3 333333 666666
I am new to SQL and I get lost between using, UNION, UNION ALL, SELECT INTO, and I am sure it’s very simple to do this. Thank you very much.
Join table to put the columns next to each other.
Union tables to put the rows after each other.