第九软件网:打造最安全放心的免费绿色软件下载站!

第九软件网

热门搜索:

access数据库多表联合查询(Left Join等)的sql语句写法

2013-08-05来源:BK网络学院
用手机看

扫描二维码随身看资讯

1. 在手机上细细品读~
2. 分享给您的微信好友或朋友圈~
使用Access里执行left join联合查询时,总是提示:至少一个参数未指定的错误。下面总结一些多表联合查询sql语句写法,希望能给大家带来一些帮助。

  又一次遇到了这个问题。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)

客官,请随便说两句