求一条SQL语句!
有两个表T1,T2
T1有字段age,
T2有字段age
我想统计这两个表age字段,归类分组(两个表相同值的归到一组),并统计每一类的行数。
[解决办法]
select age,sum(no) as sno
from (
select age,count(1) as no
from T1
uinon
select age,count(1) as no
from T2)T
group by age