select t1.a2n, t2.a3n
into C
From (
select count(*) as a2n from A where a2='A')
t1,
(select count(*) as a3n from A where a3='B'
) t2
我不知道 'into C'能不能创建一个新表 C ,请指教。
对 JYCheng(Cheng程氏) 的一点修改。
select sum(a2n) as a2n, sum(a3n) as a3n
into C
From (
select count(*) as a2n, 0 as a3n from A where a2='A'
union all
select 0 as a2n, count(*) as a3n from A where a3='B'
) temp