将Oracle SQL查询重写为Data Bricks SQL查询。任何人都可以请帮助我在下面的Oracle SQL查询是兼容的数据砖。
SELECT DISTINCT
STT_O_ID AS ANLY_S_ID,
OG AS OG_ID
FROM
(SELECT DISTINCT
M.STT_O_ID,
M.DEP_U_ID,
O.OB_OF_ANA_C_ID AS OG
FROM
(SELECT DISTINCT
CONNECT_BY_ROOT DEP1.DEP_O_ID STT_O_ID,
CONNECT_BY_ROOT DEP1.DEP_O_TYP STA_O_TYP,
DEP1.DEP_U_ID,
DEP1.DEP_UP_TYP,
LEVEL L2CHILD,
(
SYS_CONNECT_BY_PATH (DEP1.DEP_U_ID, '/')
) PRNT2CHILD_PATH
FROM
(SELECT
*
FROM
PR.DEPDGDGCY DEP
WHERE DEP.DEP_UP_TYP <> 'ALYC_S'
AND DEP.E_DT > SYSDATE) DEP1 CONNECT BY NOCYCLE PRIOR DEP1.DEP_U_ID = DEP1.DEP_O_ID
AND PRIOR DEP1.DEP_UP_TYP = DEP1.DEP_O_TYP START WITH DEP1.DEP_O_TYP = 'ALYC_S') M
LEFT JOIN PR.PLE_NUE_SRC R
ON R.PLE_ID = M.DEP_U_ID
AND R.E_DT > SYSDATE
LEFT JOIN PR.REV_SRC_IO RV
ON RV.REV_S_ID = R.REV_S_ID
AND RV.E_DT > SYSDATE
LEFT JOIN PR.REV_GOR O
ON RV.REV_OIGR_ID = O.REV_OIGR_ID
ORDER BY STT_O_ID,
OG ASC) Y
LEFT JOIN CRE.O_NMS ORGN
ON Y.OG = ORGN.OG_ID
AND ORGN.CU_N_IND = 'Y'
LEFT JOIN CRE.ORGAFDHTIO OG
ON Y.OG = OG.OG_ID
LEFT JOIN PR.SM_KY SK
ON y.STT_O_ID = SK.SM_KY_O_ID
AND SK.SMART_KEY_OBJ_TYP = 'ALYC_S'
AND SK.E_DT > SYSDATE
ORDER BY ANLY_S_ID ;
字符串
1条答案
按热度按时间2cmtqfgy1#
请尝试以下操作:
字符串