`

group + decode

 
阅读更多
SELECT G.PO_ID,
       G.PROD_ID,
       G.UNIT_ID,
       G.PO_SCHD_DATE,
       SUM(PO_QTY) PO_QTY,
       SUM(DECODE(G.PO_STAT_CD, '90', G.PO_QTY, 0)) MOVE_QTY
  FROM TB_PO_DTL G
 WHERE G.PO_STAT_CD IN ('30', '90')
 GROUP BY G.PO_ID, G.PROD_ID, G.UNIT_ID, G.PO_SCHD_DATE



  • 大小: 7.4 KB
分享到:
评论

相关推荐

    阿里微服务事务seata

    tx-service-group: my_tx_group 同时数据库驱动方式需要修改: <!--seata事务管理--> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-seata <version>2.1.0.RELEASE ...

    x25519-key-agreement-key-2020:使用2020年加密套件的X25519(Curve25519)DH(Diffie-Hellman)关键实现

    X25519KeyAgreementKey2020 (@ digitalbazaar / x25519-key-agreement-key-2020) X25519(Curve25519)DH(Diffie-Hellman)关键实现,可与X25519 2020加密套件一起使用。 目录 安全 待定 背景 ...

    Ultra PDF2.26

    本软件是一款虚拟打印驱动,能将doc, txt, ppt, xls, jtd, 123,...2,压缩:支持JPEG、JPEG2000、CCITT GROPT3、CCITT GROUP4、RUN LENGTH、FLATE DECODE,Object Stream;支持图象采样,包括抽线、平均采样和双立方采样

    Oracle高级sql学习与练习

    6、DECODE函数和行列互换 7、CASE表达式 8、ROWNUM-TOP-N分析 9、相关子查询和非相关子查询 10、增强GROUP BY 11、分析函数(ANALYTICAL FUNCTIONS) 12、ROWID的使用 13、ORACLE 10G正则表达式 14、使用HINT 15、...

    Oracle常用管理SQL

    Oracle常用管理SQL 监控 SQL 1.监控事例的等待: select event,sum(decode(wait_time,0,0,1)) prev, sum(decode(wait_time,0,1,0)) curr,count(*) from v$session_wait group by event order by 4;

    H.264标准文档

    all Blu-ray Disc players must be able to decode H.264. It is also widely used by streaming internet sources, such as videos from Vimeo, YouTube, and the iTunes Store, web software such as the Adobe ...

    自己写的基于频率的密文解密程序

    自己写的基于频率的密文解密程序 1.File List source.txt : the raw text from the router. target.txt : the text encoded. result.txt : the text to be decoded. ...5.This is not a group work.

    Oracle事例

    20.oracle8中扩充了group by rollup和cube的操作。有时候省了你好多功夫的。 下面的语句可以进行总计 select region_code,count(*) from aicbs.acc_woff_notify group by rollup(region_code); <2> 对第1个字段...

    PLSQL程序优化和性能分析方法

    2.4.11 使用DECODE函数来减少处理时间 13 2.4.12 group by优化 13 2.4.13 尽量避免用order by 14 2.4.14 用Where子句替换HAVING子句 14 2.4.15 使用表的别名(Alias) 14 2.4.16 删除重复记录 14 2.4.17 COMMIT使用 15...

    orcale常用命令

    select owner, object_type, status, count(*) count# from all_objects group by owner, object_type, status; 8、查看数据库的版本 Select version FROM Product_component_version Where SUBSTR(PRODUCT,1,6...

    python3 unicode列表转换为中文的实例

    pat = '"group": {"text": "(.*?)"' text_list = re.compile(pat).findall(text) for i in text_list: print(i.encode('latin-1').decode('unicode_escape')) 输出结果为: 以上这篇python3 unicode列表转换为

    SQL培训第一期

    select decode(x,1,'x is 1', 2 , 'x is 2','others') from dual 1.8.3.2 说明 当x等于1时,则返回‘x is 1’,当x等于2时,则返回‘x is 2’,否则,返回‘others’。 1.8.4 nulls first(nulls last)排序 1.8.4.1...

    Ultra PDF 2.26

    2、压缩:支持JPEG、JPEG2000、CCITT GROPT3、CCITT GROUP4、RUN LENGTH、FLATE DECODE,Object Stream;支持图象采样,包括抽线、平均采样和双立方采样 3、字体嵌入:支持单、双字节字体嵌入,嵌入字体子集化;支持...

    Mpeg2_Decoder

    mpeg2encode / mpeg2decode ========================= MPEG-2 Encoder / Decoder, Version 1.2, July 19, 1996 <br> Copyright (c) 1996 MPEG Software Simulation Group <br> E-mail: mssg@...

    关系型数据库性能体系设计和效率提升.docx

    7.13 使用DECODE函数来减少处理时间 24 7.14 尽量避免用order by 25 7.15 用Where子句替换HAVING子句 25 7.16 减少多表关联 25 7.17 避免重复访问 26 7.17.1 使用group by 26 7.17.2 用表更新表 26 7.17.3竖向显示变...

    ExtJSWeb应用程序开发指南(第2版)

    6.9.1 decode() 6.9.2 encode() 6.10 Ext.util.MixedCollection 6.10.1 向集合加入对象 6.10.2 将数组中的对象加入到集合中 6.10.3 移除集合中的对象 6.10.4 克隆集合 6.10.5 匹配集合中关联对象 6.10.6...

    ICS delphixe10源码版

    ICS - Internet Component Suite - V8 - Delphi 7 to RAD Studio 10 Seattle ======================================================================= (Aka FPIETTE's Components) Revised: March 3, 2016 ...

    最全的oracle常用命令大全.txt

    select owner, object_type, status, count(*) count# from all_objects group by owner, object_type, status; 8、查看数据库的版本 Select version FROM Product_component_version Where SUBSTR(PRODUCT,1,6...

    Sakemail

    1997 - 2003 Sergio A. Kessler web: http://groups.yahoo.com/group/sakemail/To subscribe to the mailing list of sakemail, just go to...and fixed it. Some minor bugs that I don‘t remember fixed.- Added ...

Global site tag (gtag.js) - Google Analytics