sang8453 2016-10-27 05:58 采纳率: 100%
浏览 6972
已采纳

oracle 把三个查询结果 合并在一起显示

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;

三个语句查询三个结果,怎么让他们在一起显示,不重叠,显示三条
  • 写回答

4条回答 默认 最新

  • little_how 2016-10-27 06:05
    关注

    把你的三个语句分别用()括起来,然后使用union关键字就可以

    希望可以帮到你....

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?