。Access里执行left join联合查询,总是提示:至少一个参数未指定的错误,突然想起来access中多表联合查询的sql语句比较变态,就抄来高手的文章备忘,希望对和我一样的苦逼程序员有所帮助。
首先,每次联合查询都需要用圆括号括起来:
SELECT * FROM (aa LEFT JOIN bb ON aa.a = bb.a ) LEFT JOIN cc ONcc.a = bb.a;
注意:在使用join语句查询时,如果有加多个On条件,必须用括号括起来,如:
SELECT * FROM (aa LEFT JOIN bb ON aa.a=bb.a) LEFT JOIN cc ON(bb.a=cc.a and bb.b=cc.b)
其他例子可以参考:
1、SELECT * FROM URL as a LEFT OUTER JOIN MobileAfter as b ON a.URL = b.URL
2、SELECT * FROM (URL as a LEFT OUTER JOIN MobileAfter as b ON a.URL= b.URL) LEFT OUTER JOIN MobileBefore as c ONc.URL=a.URL
3、SELECT * INTO Ttable1 FROM ((((URL as a
LEFT OUTER JOIN MobileAfter as b ON a.URL=b.URL)
LEFT OUTER JOIN MobileBefore as c ON c.URL=a.URL)
LEFT OUTER JOIN TeleCOM as d ON d.URL=a.URL)
LEFT OUTER JOIN UniCOM as e ON e.URL=a.URL)
熟悉的调,会不会是第一个把闽南哭腔用音符弹出来的----很小的时候就注意到有的大人可以哭笑自如,前一秒和人有说有笑,下一秒情绪立马上来,哭到有人喊停的下一秒又有说有笑了——等弹出撕心裂肺的感觉时, 万宝山庄摆摊。