SELECT t2.FENTRYID ,
t2.FSEQ ,
t2.FMATERIALID ,
T3.FENTRYID ,
T3.FSEQ ,
T3.FMATERIALID ,
t21.FROWID
FROM T_SAL_XORDER t1
JOIN T_SAL_XORDERENTRY t2 ON t1.FID = t2.FID
LEFT JOIN T_SAL_XORDERENTRY_E t21 ON t2.FID = t21.FID
AND t2.FENTRYID = t21.FENTRYID
LEFT JOIN T_SAL_ORDERENTRY_E T31 ON T31.FROWID = t21.FROWID
LEFT JOIN T_SAL_ORDERENTRY T3 ON T3.FID = T31.FID
AND T3.FENTRYID = T31.FENTRYID
WHERE FBILLNO = 'XSDD000297_V001'
--查询下推需要的信息
SELECT T_SAL_ORDERENTRY.FID ,
T_SAL_ORDERENTRY.FENTRYID ,
T_SAL_ORDERENTRY.FSEQ
FROM T_SAL_XORDERENTRY
LEFT JOIN T_SAL_XORDERENTRY_E ON T_SAL_XORDERENTRY.FENTRYID = T_SAL_XORDERENTRY_E.FENTRYID
LEFT JOIN T_SAL_ORDERENTRY_E ON T_SAL_XORDERENTRY_E.FROWID = T_SAL_ORDERENTRY_E.FROWID
LEFT JOIN T_SAL_ORDERENTRY ON T_SAL_ORDERENTRY.FENTRYID = T_SAL_ORDERENTRY_E.FENTRYID
WHERE T_SAL_XORDERENTRY.FENTRYID IN ( {1} )