我正在接受
Syntax error in JOIN operation
此查询出错。这表明在连接中的某个地方有一个错位的括号,但我无法弄清楚出了什么问题。
select *
from
((ss
left join
sc
on
ss.guid=sc.guid)
left join
mrc
on
format(c.xDate, "yyyymmddHHMMSS")=mrc.xDate)
left join
c
on
sc.cID=c.id
答案 0 :(得分:3)
您收到错误是因为c
在定义之前被引用:
select *
from ((ss left join
sc
on ss.guid = sc.guid
) left join
mrc
on format(c.xDate, "yyyymmddHHMMSS") = mrc.xDate
----------------^
) left join
c
on sc.cID = c.id
您可以通过交换联接来解决此问题:
select *
from ((ss left join
sc
on ss.guid = sc.guid
) left join
c
on sc.cID = c.id
) left join
mrc
on format(c.xDate, "yyyymmddHHMMSS") = mrc.xDate