我有两个查询来获得数据加入两个SELECT在SQL的,我想在同一个表,以显示他们两个:两列
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
而我只是想展示在同一个数据有两列
Text1 111111 444444
Text2 222222 555555
Text3 333333 666666
我新的SQL,我开始使用,UNION,UNION ALL之间丢失表,SELECT INTO,我相信这是非常简单的做到这一点。非常感谢你。
上a.Text = b.Text – 2012-08-03 08:59:17
@JoeGJoseph'USING'是优选的。 – Ariel 2012-08-03 08:59:31
谢谢Ariel ..我不知道 – 2012-08-03 09:05:03