select a.type1,a.count1, a.count1 / d.count4 bf,a.tooling1, a.piece1 from (select count(*) count1,
sum(toolingcost) tooling1, sum(piececost) piece1, type type1 from TC_NEIT_EWO_ALARM
where type = '过期报警(Usage级别)' group by type) a,(select count(*) count4 from TC_NEIT_EWO_ALARM
where category = 'EWO') d;
select a.type1,a.count1, a.count1 / d.count4 bf,a.tooling1, a.piece1 from (select count(*) count1,
sum(toolingcost) tooling1, sum(piececost) piece1, type type1 from TC_NEIT_EWO_ALARM
where type = '迫近提醒(Usage级别)' group by type) a,(select count(*) count4 from TC_NEIT_EWO_ALARM
where category = 'EWO') d;
select a.type1,a.count1, a.count1 / d.count4 bf,a.tooling1, a.piece1 from (select count(*) count1,
sum(toolingcost) tooling1, sum(piececost) piece1, type type1 from TC_NEIT_EWO_ALARM
where type = '升级报警(Usage级别)' group by type) a,(select count(*) count4 from TC_NEIT_EWO_ALARM
where category = 'EWO') d;
三个语句查询三个结果,怎么让他们在一起显示,不重叠,显示三条
把你的三个语句分别用()括起来,然后使用union关键字就可以
希望可以帮到你....
着急等,验证可以,立马给
UNION ALL 就解决了,无语
三个查询语句用union all进行连接,如果只需要3条,然后在top 3