sql相同項求和


 select (SELECT O2.ORG_NAME
           FROM OUTSOURCE_ORG O2
          where o2.org_id = oo.parent_id) net_NAME,
        oo.parent_id,
        sum(oz.line_length) as net_length
 
   from outsource_org oo, outsource_zone_line_length oz
  where oz.line_length is not null
    and oo.org_type = '5'
    and to_char(oo.org_id) = oz.zone_id
 
  group by oo.parent_id
  order by oo.parent_id


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM