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

sql相同项求和的更多相关文章

  1. Excel对同样项求和

    版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/yeweiouyang/article/details/32107423 方法一(SUMIF公式求和) ...

  2. SQL Server迭代求和

    drop table t_geovindu create table t_geovindu ( xid int IDENTITY (1, 1), price money, DebitCredit VA ...

  3. SQL server 累加求和

    1. SELECT SalesOrderID, ProductID, OrderQty    ,SUM(OrderQty) OVER(PARTITION BY SalesOrderID) AS Tot ...

  4. sql 多列求和

    列相加即可注意Null不可加,先用ISNULL方法验证,设置默认值 SELECT ID, Name, Province, City, District, ISNULL(row1, 0), ISNULL ...

  5. Sql Server 2008卸载后再次安装一直报错

    sql server 2008卸载之后再次安装一直报错问题. 第一:由于上一次的卸载不干净,可参照百度完全卸载sql server2008 的方式 1. 用WindowsInstaller删除所有与S ...

  6. Informix 11.5 SQL 语句性能监控方法及实现

    我们知道,在数据库应用系统中,SQL 语句的性能好坏至关重要.如果 SQL 语句性能很差,可能会导致整个数据库应用系统的性能也非常差.那么,如何监控数据库系统中 SQL 语句的性能,导致 SQL 语句 ...

  7. SQL中空值与NULL区别

    很多人都有过这样的问题吧   在SQL中填充空值与NULL有什么区别 现在我以一个实例给大家分享一下自己的想法  恳请大家给予批评也指正 谢谢 创建一个监时表 CREATE TABLE #temp ( ...

  8. Sql之表的连接总结

    1.交叉连接(就是将两张表的数据 交叉组合在一起) 有两张表 客户表:[Sales.Customers] 和订单表:[Sales.Orders]. 业务需求:实现 Customer中custid(客户 ...

  9. 微软ASP.NET网站部署指南(10):迁移至SQL Server

    1.  综述 第2章的部署SQL Server Compact和第9章的部署数据库更新里解释了为什么终于要升级到完整版SQL Server .本章节将告诉你怎样来做. SQL Server Expre ...

随机推荐

  1. codeblocks安装(自带gcc编译器)

    下载安装自带c编译器的的codeblocks. 网址:http://www.codeblocks.org/downloads/26 自带gcc编译器的版本 codeblocks-16.01mingw- ...

  2. 20. Valid Parentheses (Stack)

    Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the inpu ...

  3. 189. Rotate Array(Array)

    Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array ...

  4. Camera插件推荐,解锁电影大师级视角控制

    相机在游戏中的重要性是不言而喻的,尤其是一些MMORPG或FPS等类型的游戏,相机不仅需要跟随游戏主角进行移动,可能还要随时准备切换焦点,这就要求开发者将游戏相机管理得井井有条,能顺应游戏中可能瞬息发 ...

  5. jquey中json字符串与json的转换(转)

    <!doctype html> <html> <head> <meta charset="utf-8"> <script sr ...

  6. JDK1.5 Excutor 与ThreadFactory

    Excutor 源码解读: /** * An object that executes submitted {@link Runnable} tasks. This * interface provi ...

  7. spring+quartz报错:Table 'XXXX.QRTZ_TRIGGERS' doesn't exist

    Spring4.3.4 + quartz2.2.1配置到application.xml中 <properties> <spring.version>4.3.4.RELEASE& ...

  8. webpack浅析---入口篇

    webpack有四个核心概念: 入口(entry) 输出(output) loader 插件(plugins) webpack-merge将环境.构建目标.运行时合并 入口: 入口起点是指webpac ...

  9. vue总结2

    1. 给router-link添加事件 之前用v-link 现在用 router-link 添加事件要用原生的.native修饰v-on <my-component v-on:click.nat ...

  10. Extjs如何添加多个Vtype

    http://devjs.eu/en/multiple-validation-multi-vtype-for-textfield-in-ext-js-4/