标题:这个是什么意思
只看楼主
袁翠翠
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2022-6-14
结帖率:0
已结贴  问题点数:20 回复次数:5 
这个是什么意思
SELECT T3.FDATE 生产订单日期,T2.F_BAHSCDDH 生产订单编号,T3.FDATAVALUE 工作令,T3.CPBM 对应产品编码,T3.FNUMBER 物料编码,T3.WLMC 物料名称,T3.FSPECIFICATION 规格型号,
       T3.FQTY 数量,T1.F_BAH_DATE 开工时间,T5.WGRQ 完工时间,T4.FNAME 工序名称 FROM BAH_t_Cust100002 T1
    LEFT JOIN BAH_t_Cust_Entry100046 T2 ON T1.FID=T2.FID
    LEFT JOIN (SELECT T1.FBILLNO,T1.FDATE,T3.FNUMBER,T3.FNAME WLMC,T3.FSPECIFICATION,T4.FNUMBER CPBM,T5.FDATAVALUE,T2.FQTY FROM T_PRD_MO T1
                    LEFT JOIN T_PRD_MOENTRY T2 ON T1.FID=T2.FID
                    LEFT JOIN (SELECT A.FMATERIALID,A.FNUMBER,B.FNAME,B.FSPECIFICATION,A.FBAHTEXTURE FROM T_BD_MATERIAL A
                                    LEFT JOIN T_BD_MATERIAL_L B ON A.FMATERIALID=B.FMATERIALID) T3 ON T2.FMATERIALID=T3.FMATERIALID
                    LEFT JOIN T_BD_MATERIAL T4 ON T2.FBAHSCDDCPMC=T4.FMATERIALID
                    LEFT JOIN (select T1.FENTRYID,T2.FDATAVALUE from T_BAS_ASSISTANTDATAENTRY T1
                                    LEFT JOIN T_BAS_ASSISTANTDATAENTRY_L T2 ON T1.FENTRYID=T2.FENTRYID) T5 ON T2.FBAHWORK=T5.FENTRYID) T3 ON T2.F_BAHSCDDH=T3.FBILLNO
    LEFT JOIN T_ENG_PROCESS_L T4 ON T1.F_BAHGYMC=T4.FID
    LEFT JOIN (SELECT T1.F_BAH_DATE WGRQ,T1.F_BAHGXMC,T2.F_BAHSCDDH FROM BAH_t_Cust100004 T1
                  LEFT JOIN BAH_t_Cust_Entry100049 T2 ON T1.FID=T2.FID
                UNION ALL
               SELECT T1.F_BAH_DATE,T1.F_BAHGYMC,T2.F_BAHSCDDH FROM BAH_t_Cust100003 T1
                  LEFT JOIN BAH_t_Cust_Entry100047 T2 ON T1.FID=T2.FID) T5 ON T1.F_BAHGYMC=T5.F_BAHGXMC AND T2.F_BAHSCDDH=T5.F_BAHSCDDH
搜索更多相关主题的帖子: FROM LEFT SELECT 编码 JOIN 
2022-06-14 13:51
袁翠翠
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2022-6-14
得分:0 
这是金蝶云上面二开的一张代码表,有哪位大神解释一下是什么意思
2022-06-14 13:52
mywisdom88
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:190
帖 子:3125
专家分:8340
注 册:2015-3-25
得分:20 

一组 LEFT JOIN 对应一个ON,即
LEFT JOIN   ...... ON
带子查询的
一组 LEFT JOIN (.......)对应一个ON,即
LEFT JOIN(......)...... ON



[此贴子已经被作者于2022-6-15 09:13编辑过]

2022-06-15 08:45
mywisdom88
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:190
帖 子:3125
专家分:8340
注 册:2015-3-25
得分:0 

这个神人,多次使用相同的别名,来混淆阅读;
2022-06-15 09:25
mywisdom88
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:190
帖 子:3125
专家分:8340
注 册:2015-3-25
得分:0 
故意写混淆的,其实包含多个子查询,最好别名分类,如
select t1.* from XXXX1 t1
left join XXXX2 t2
on t1.xx=t2.yy
left join(select f1.* from XXXX3 f1
          left join XXXX4 f2
          on f1.aa=f2.bb) t3
on t3.cc=t1.bb
大概这样,以后方便其他人阅读         

[此贴子已经被作者于2022-6-15 09:38编辑过]

2022-06-15 09:37
MayBeDream
Rank: 1
等 级:新手上路
帖 子:3
专家分:6
注 册:2022-6-23
得分:0 
2022-06-23 16:22



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-509337-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.049624 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved