SQLite 中嵌套内连接的问题
下面的sql语句不会在SQLite中运行:
select *
from A
left join (B inner join C on B.fkC = C.pk) on A.optionalfkB = B.pk
我得到一个sqlException“未知列B.pk”
根据文档@ http://www.sqlite.org/lang_select.html 这应该可以工作,并且它可以在所有其他 sql 实现中工作。我做错了什么吗?
The sql statement below will not run in SQLite:
select *
from A
left join (B inner join C on B.fkC = C.pk) on A.optionalfkB = B.pk
I get a sqlException "unknown column B.pk"
According to the documentation @ http://www.sqlite.org/lang_select.html this should work, and it will work in all other sql implementations. Am I doing something wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它不起作用,因为“外部”查询不知道 B 是什么。
如果没有任何
select
,(B inner join C on B.fkC = C.pk)
很奇怪,但规范确实说它是有效的。It doesn't work because the "outer" query doesn't know what B is.
The
(B inner join C on B.fkC = C.pk)
is weird without anyselect
, but the specification does say that it is valid.