首页 > 其他分享 >select a.c_port_code,

select a.c_port_code,

时间:2023-08-23 11:22:51浏览次数:34  
标签:code port PORT CODE DWJZ aststat select

select a.c_port_code,
a.c_port_name,
to_char(A1.D_ASTSTAT,'yyyy-mm-dd') D_ASTSTAT,
CASE WHEN A.C_DAT_CODE in ('ASS_FOF','ASS_QDII') THEN NVL(A11.DWJZ,A111.DWJZ) ELSE A1.DWJZ END DWJZ,
CASE WHEN A.C_DAT_CODE in ('ASS_FOF','ASS_QDII') THEN NVL(A22.LJDWJZ,A222.LJDWJZ) ELSE A2.LJDWJZ END LJDWJZ,
CASE
WHEN A.C_DAT_CLS = 'CLS_HB' THEN
CASE WHEN A.C_DAT_CODE in ('ASS_FOF','ASS_QDII') THEN NVL(A33.ZCJZ2,A333.ZCJZ2) ELSE A3.ZCJZ2 END
ELSE
CASE WHEN A.C_DAT_CODE in ('ASS_FOF','ASS_QDII') THEN NVL(A33.ZCJZ1,A333.ZCJZ1) ELSE A3.ZCJZ1 END
END AS ZCJZ,
case when nvl(a4.dwjz,0)=0 then 0 else nvl(CASE WHEN A.C_DAT_CODE in ('ASS_FOF','ASS_QDII') THEN NVL(A11.DWJZ,A111.DWJZ) ELSE A1.DWJZ END,0)/nvl(a4.dwjz,0) - 1 end DWJZ1,
case when nvl(a5.dwjz,0)=0 then 0 else nvl(CASE WHEN A.C_DAT_CODE in ('ASS_FOF','ASS_QDII') THEN NVL(A11.DWJZ,A111.DWJZ) ELSE A1.DWJZ END,0)/ nvl(a5.dwjz,0) - 1 end DWJZ2,
CASE WHEN A.C_DAT_CODE in ('ASS_FOF','ASS_QDII') THEN NVL(a66.LJJZZZL,a666.LJJZZZL) ELSE a6.LJJZZZL END LJJZZZL,
to_char(b.D_RECORD_REVIEW_DATE,'yyyy-mm-dd')D_RECORD_REVIEW_DATE,
a7.n_sell_money1,
a8.n_sell_money2
from T_P_AB_PORT a
left join T_P_AB_PORT_PD b
on a.c_port_code = b.c_port_code
left join (SELECT a.c_port_code, a.d_aststat, a.C_KM_NAME DWJZ
FROM t_r_fr_aststat a
where ((A.C_PORT_CODE = 'SGU520'))
and a.d_aststat = date
'2023-07-01'
and a.c_key_code = 'DWJZ'
and instr(a.c_km_code, '_') = 0) A1
ON A.C_PORT_CODE = A1.C_PORT_CODE

left join (SELECT a.c_port_code, a.d_aststat, a.C_KM_NAME DWJZ
FROM t_r_fr_aststat a
where ((A.C_PORT_CODE = 'SGU520'))
and a.d_aststat = GETDAY_HDAY('CN',LAST_DAY(date'2023-07-01')+1,-1,'W')
and a.c_key_code = 'DWJZ'
and instr(a.c_km_code, '_') = 0) A11
ON A.C_PORT_CODE = A11.C_PORT_CODE

left join (SELECT a.c_port_code, a.d_aststat, a.C_KM_NAME DWJZ
FROM t_r_fr_aststat a
where ((A.C_PORT_CODE = 'SGU520'))
and a.d_aststat = GETDAY_HDAY('CN',TRUNC(date'2023-07-01','MM'),-1,'W')
and a.c_key_code = 'DWJZ'
and instr(a.c_km_code, '_') = 0) A111
ON A.C_PORT_CODE = A11.C_PORT_CODE

left join (SELECT a.c_port_code, a.d_aststat, a.C_KM_NAME LJDWJZ
FROM t_r_fr_aststat a
where ((A.C_PORT_CODE = 'SGU520'))
and a.d_aststat = date
'2023-07-01'
and a.c_key_code = 'LJDWJZ'
and instr(a.c_km_code, '_') = 0) A2
ON A.C_PORT_CODE = A2.C_PORT_CODE

left join (SELECT a.c_port_code, a.d_aststat, a.C_KM_NAME LJDWJZ
FROM t_r_fr_aststat a
where ((A.C_PORT_CODE = 'SGU520'))
and a.d_aststat = GETDAY_HDAY('CN',LAST_DAY(date'2023-07-01')+1,-1,'W')
and a.c_key_code = 'LJDWJZ'
and instr(a.c_km_code, '_') = 0) A22
ON A.C_PORT_CODE = A22.C_PORT_CODE

left join (SELECT a.c_port_code, a.d_aststat, a.C_KM_NAME LJDWJZ
FROM t_r_fr_aststat a
where ((A.C_PORT_CODE = 'SGU520'))
and a.d_aststat = GETDAY_HDAY('CN',TRUNC(date'2023-07-01','MM'),-1,'W')
and a.c_key_code = 'LJDWJZ'
and instr(a.c_km_code, '_') = 0) A222
ON A.C_PORT_CODE = A222.C_PORT_CODE

left join (SELECT a.c_port_code,
a.d_aststat,
A.N_PORT_MV ZCJZ1,
a.N_PORT_COST ZCJZ2
FROM t_r_fr_aststat a
where ((A.C_PORT_CODE = 'SGU520'))
and a.d_aststat = date
'2023-07-01'
and a.c_key_code = 'ZCJZ'
and instr(a.c_km_code, '_') = 0) A3
ON A.C_PORT_CODE = A3.C_PORT_CODE

left join (SELECT a.c_port_code,
a.d_aststat,
A.N_PORT_MV ZCJZ1,
a.N_PORT_COST ZCJZ2
FROM t_r_fr_aststat a
where ((A.C_PORT_CODE = 'SGU520'))
and a.d_aststat = GETDAY_HDAY('CN',LAST_DAY(date'2023-07-01')+1,-1,'W')
and a.c_key_code = 'ZCJZ'
and instr(a.c_km_code, '_') = 0) A33
ON A.C_PORT_CODE = A33.C_PORT_CODE

left join (SELECT a.c_port_code,
a.d_aststat,
A.N_PORT_MV ZCJZ1,
a.N_PORT_COST ZCJZ2
FROM t_r_fr_aststat a
where ((A.C_PORT_CODE = 'SGU520'))
and a.d_aststat = GETDAY_HDAY('CN',TRUNC(date'2023-07-01','MM'),-1,'W')
and a.c_key_code = 'ZCJZ'
and instr(a.c_km_code, '_') = 0) A333
ON A.C_PORT_CODE = A333.C_PORT_CODE

left join (SELECT a.c_port_code, a.d_aststat, a.C_KM_NAME DWJZ
FROM t_r_fr_aststat a
where ((A.C_PORT_CODE = 'SGU520'))
and a.d_aststat = trunc(date'2023-07-01','mm')-1
and a.c_key_code = 'DWJZ'
and instr(a.c_km_code, '_') = 0) A4
ON A.C_PORT_CODE = A4.C_PORT_CODE
left join (SELECT a.c_port_code, a.d_aststat, a.C_KM_NAME DWJZ
FROM t_r_fr_aststat a
where ((A.C_PORT_CODE = 'SGU520'))
and a.d_aststat = trunc(date'2023-07-01','yyyy')-1
and a.c_key_code = 'DWJZ'
and instr(a.c_km_code, '_') = 0) A5
ON A.C_PORT_CODE = A5.C_PORT_CODE

left join (SELECT a.c_port_code, a.d_aststat, a.C_KM_NAME LJJZZZL
FROM t_r_fr_aststat a
where ((A.C_PORT_CODE = 'SGU520'))
and a.d_aststat = date
'2023-07-01'
and a.c_key_code = 'LJJZZZL'
and instr(a.c_km_code, '_') = 0) A6
ON A.C_PORT_CODE = A6.C_PORT_CODE

left join (SELECT a.c_port_code, a.d_aststat, a.C_KM_NAME LJJZZZL
FROM t_r_fr_aststat a
where ((A.C_PORT_CODE = 'SGU520'))
and a.d_aststat = GETDAY_HDAY('CN',LAST_DAY(date'2023-07-01')+1,-1,'W')
and a.c_key_code = 'LJJZZZL'
and instr(a.c_km_code, '_') = 0) A66
ON A.C_PORT_CODE = A66.C_PORT_CODE

left join (SELECT a.c_port_code, a.d_aststat, a.C_KM_NAME LJJZZZL
FROM t_r_fr_aststat a
where ((A.C_PORT_CODE = 'SGU520'))
and a.d_aststat = GETDAY_HDAY('CN',TRUNC(date'2023-07-01','MM'),-1,'W')
and a.c_key_code = 'LJJZZZL'
and instr(a.c_km_code, '_') = 0) A666
ON A.C_PORT_CODE = A666.C_PORT_CODE

left join (


select a.c_port_code, sum(a.N_SELL_MONEY) N_SELL_MONEY1 from T_D_AC_SELL_TA a
where (A.C_PORT_CODE = 'SGU520')
and a.D_SELL = date
'2023-07-01'
and a.C_DS_CODE = 'TAXS_SG'
and a.N_CHECK_STATE = 1
group by a.c_port_code
) a7
ON A.C_PORT_CODE = A7.C_PORT_CODE

left join (


select a.c_port_code, sum(a.N_SELL_MONEY) N_SELL_MONEY2 from T_D_AC_SELL_TA a
where (A.C_PORT_CODE = 'SGU520')
and a.D_SELL = date
'2023-07-01'
and a.C_DS_CODE = 'TAXS_SH'
and a.N_CHECK_STATE = 1
group by a.c_port_code
) a8
ON A.C_PORT_CODE = A8.C_PORT_CODE

where (A.C_PORT_CODE = 'SGU520')
and a.N_CHECK_STATE = 1

标签:code,port,PORT,CODE,DWJZ,aststat,select
From: https://www.cnblogs.com/wugongben/p/17650716.html

相关文章

  • 如何与 UNI-SELECT 建立 EDI 连接?
    UNI-SELECT是一家专注于汽车零部件分销的领先企业,致力于为全球客户提供优质的汽车维修、保养和美容产品,以满足不断变化的市场需求。多年来,UNI-SELECT凭借卓越的服务和高品质的产品赢得了众多荣誉和认可,不断推动着整个汽车零部件供应链的发展。项目挑战实施EDI项目需要注意:......
  • SELECT a.c_port_code, a.d_aststat, a.C_KM_NAME DWJZ
    SELECTa.c_port_code,a.d_aststat,a.C_KM_NAMEDWJZFROMt_r_fr_aststatawhere(A.C_PORT_CODE='SGU520')anda.d_aststat=GETDAY_HDAY('CN',LAST_DAY(date'2023-07-01')+1,-1,'W&#......
  • leetcode-1-two sum(brute force, hash table)
    Wecanusebruteforcetogetit,usetwoforloopiandj,whichi=1:nandj=i:n.However,thetimecomplexityisO(n^2),whichisnotefficient.Usehashtable,thefirstthingisfirststoreeveryelementtotable,thendotraverseagaintolookup......
  • 继copilot之后,又一款免费帮你写代码的插件CodeGeeX
    合集-开发工具(6)  1.Weblogic11g安装部署-winserver篇05-072.给你安利一款国产良心软件uTools05-133.gitee图床不能用了,心态崩了05-164.windows环境下如何优雅搭建ftp服务?05-175.IntelliJIDEA上手这一篇就够了,从入门到上瘾05-226.继copilot之后,又一款免费帮你写代......
  • 如何配置VScode的C++环境
    你需要:VScodeMinGW没了安装VScode在VScode官网下载VScode。打开VScode,点击扩展,输入Chinese,下载Chinese(Simplified)(简体中文)LanguagePackforVisualStudioCode,安装中文包并重启。MinGW在MinGW官网下载MinGW。下载x86_64-posix-sjlj压缩包速度快,解压到......
  • Leetcode 459——重复的子字符串
    给定一个非空的字符串 s ,检查是否可以通过由它的一个子串重复多次构成。示例1:输入:s="abab"输出:true解释:可由子串"ab"重复两次构成。示例2:输入:s="aba"输出:false示例3:输入:s="abcabcabcabc"输出:true解释:可由子串"abc"重复四次构成。......
  • 前端codeReview规范指南
    一定要看的前端codeReview规范指南 一、前言针对目录结构、CSS规范、JavaScript规范、Vue规范可参照官方给出的 风格指南这里主要总结业务开发中常遇到的代码问题和实践,帮助大家后续各自做好codeReview,一些你遇到的典型问题,也可以在留言区评论,帮助团队共同进步。二、实践规......
  • [LeetCode][72]edit-distance
    ContentGiventwostringsword1andword2,returntheminimumnumberofoperationsrequiredtoconvertword1toword2.Youhavethefollowingthreeoperationspermittedonaword:InsertacharacterDeleteacharacterReplaceacharacter Example1:In......
  • Leetcode 349.两个数组的交集(Intersection of two arrays)
    题目链接......
  • Ubuntu 20.04编译opencv-3.1.0时报错 error: 'CODEC_FLAG_GLOBAL_HEADER' was not dec
    Ubuntu20.04源码编译安装opencv320报错error:'CODEC_FLAG_GLOBAL_HEADER'wasnotdeclaredinthisscope的解决办法:修改/opt/opencv/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp,顶端添加如下代码:#defineAV_CODEC_FLAG_GLOBAL_HEADER(1<<22)#defineCODEC_F......