oracal来源不同表的结果集合并

select kinds,count(1) as cl from t_b_current_alarm group by kinds union all select 'sj' kinds, count(*) as cl from T_B_TROUBLEWORK t where t.status like '%处理中%'

常量放在前面是确定好他的值

kinds cl
aqgj   1
wlgj   92
sj     4

你可能感兴趣的:(oacle)