13,097
社区成员
发帖
与我相关
我的任务
分享(select aId, count(distinct btype) as all_type from B group by aId) c
(select aId, count(distinct btype) as no_use_type from B where bDate is null group by aId) dselect a.aName, b.btype, c.all_type, d.no_use_type
from A a, B b,
(select aId, count(distinct btype) from B group by aId) c,\
(select aId, count(distinct btype) from B where bDate is null group by aId) d
where a.aId = b.aId
and a.aId = c.aId
and a.aId = d.aId
order by a.aName