内连接有三个表给出错误

时间:2015-04-24 12:15:43

标签: join inner-join

我有三张名为sehirler,ilceler,mahalle的表。我想连接这三个表来获取一些相关信息。我使用以下查询:

SELECT sehirler.sehirad,
    sehirler.sehirid,
    ilceler.ilcead,
    ilceler.ilceid,
    ilceler.sehirid,
    mahalle.mahallead,
    mahalle.ilceid
FROM sehirler
INNER JOIN ilceler
    ON sehirler.sehirid = ilceler.sehirid
INNER JOIN mahalle
    ON ilceler.ilceid = mahalle.ilceid

并收到以下错误消息:

  

Microsoft JET数据库引擎错误' 80040e14'

Syntax error (missing operator) in query expression 'sehirler.sehirid=ilceler.sehirid INNER JOIN mahalle ON ilceler.ilceid= mahalle.ilceid'.

/subs.asp, line 89 

我无法找到错误,请你帮助我。我在哪里弄错了?

表-1:Sehirler只有两列:sehirid和sehirad
表-2:ilceler有三列:ilceid,ilcead,sehirid
表-3:mahalle有四列:mahalleid,mahallead,ilceid,sehirid

0 个答案:

没有答案