zoukankan      html  css  js  c++  java
  • sql 记录

    select '总排量' as pollutantName,
           SUM(w.CORRECT_EMITOUT_VALUE),
           '0' AS totalEV
      from D_WATER_EMITION_HOUR_DATA w
     where w.sample_time between
           to_date('2011-05-24 00:00:00', 'YYYY-MM-DD HH24:MI:SS') and
          sysdate
       and w.pollution_code = '34010000000232'
    --group by w.pollution_code

    union

    select s.name as pollutantName,
           sum(w.correct_emitout_value),
           '1' as totalEV
      from D_WATER_POLLUTANT_HOUR_DATA w, s_pollutant_code s
     where w.sample_time between
           to_date('2011-05-24 00:00:00', 'YYYY-MM-DD HH24:MI:SS') and
           sysdate
         
       and w.pollution_code = '34010000000232'
       and s.code = w.pollutant_code
     group by w.POLLUTANT_CODE, s.name
     union
     select s.name as pollutantName,
           sum(g.correct_emitout_value),
           '2' as totalEV
      from d_gas_pollutant_hour_data g, s_pollutant_code s
     where g.sample_time between
           to_date('2011-05-24 00:00:00', 'YYYY-MM-DD HH24:MI:SS') and
          sysdate
       and g.pollution_code = '34010000000232'
       and s.code = g.pollutant_code
     group by g.POLLUTANT_CODE, s.name

     order by totalEV

  • 相关阅读:
    react.js
    shell if,case,for,while语法
    shell判断文件类型和权限
    shell编程之sed语法
    php魔术方法__SET __GET
    git 忽略文件.gitignore
    php设置错误,错误记录
    linux ifconfig显示 command not found
    数据库备份与恢复
    mysql主要技术
  • 原文地址:https://www.cnblogs.com/hl3292/p/2125844.html
Copyright © 2011-2022 走看看