标题:多表联合之后提示语法错误。
只看楼主
hyz00001
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:168
专家分:137
注 册:2012-10-5
结帖率:100%
 问题点数:0 回复次数:3 
多表联合之后提示语法错误。
最近新学习了多表联合,却不能使用,很是遗憾。
帮忙看看那里出现了错误,谢谢。
SELECT distinc workshop,no,user,date,t,pn,status,gjqty,t2.zytime,t3.qty,t4.ll FROM rwd t1 LEFT JOIN ;
(sele DISTINCT rwd,SUM(zytime) zytime  FROM gshb WHERE zytime >0 GROUP BY ) t2 ON t1.no =t2.rwd LEFT JOIN ;
(sele rwd,SUM(qty)qty FROM fgrk t1 LEFT JOIN location t2 ON t1.ck =t2.ck  WHERE t2.hs ='是' GROUP BY 1) t3 ON t1.no =t3.rwd left join;
(sele t1.rwd,SUM(t1.qty*t2.price) ll from scll t1 left join stdcost t2 on t1.pn =t2.pn GROUP BY 1 ) t4 on t1.no =t4.rwd
搜索更多相关主题的帖子: 联合 status 
2014-05-27 21:50
hyz00001
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:168
专家分:137
注 册:2012-10-5
得分:0 
粗心大意,找到答案了
SELECT distinc workshop,no,user,date,t,pn,status,gjqty,t2.zytime,t3.qty,t4.ll FROM rwd t1 LEFT JOIN ;
(sele DISTINCT rwd,SUM(zytime) zytime  FROM gshb WHERE zytime >0 GROUP BY 1) t2 ON t1.no =t2.rwd LEFT JOIN ;
(sele rwd,SUM(qty)qty FROM fgrk t1 LEFT JOIN location t2 ON t1.ck =t2.ck  WHERE t2.hs ='是' GROUP BY 1) t3 ON t1.no =t3.rwd left join;
(sele t1.rwd,SUM(t1.qty*t2.price) ll from scll t1 left join stdcost t2 on t1.pn =t2.pn GROUP BY 1 ) t4 on t1.no =t4.rwd
2014-05-27 21:51
taifu945
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:80
帖 子:1545
专家分:3298
注 册:2012-7-6
得分:0 
楼主,这是多表联接,不是联合。
2014-05-28 10:18
hyz00001
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:168
专家分:137
注 册:2012-10-5
得分:0 
那是。
2014-05-29 11:24



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




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

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