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

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条)

报告相同问题?

悬赏问题

  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?