SELECT ship from Outcomes outer
WHERE EXIST(select ship from Outcomes inner
where inner.ship=outer.ship
)
我为什么会收到错误SQL错误 - “关键字附近的不正确语法“WHERE”
“不正确的语法关键字接近” WHERE”
SELECT ship from Outcomes outer
WHERE EXIST(select ship from Outcomes inner
where inner.ship=outer.ship
)
我为什么会收到错误SQL错误 - “关键字附近的不正确语法“WHERE”
“不正确的语法关键字接近” WHERE”
外部和内部保留关键字。您可以更好地利用其他别名或放在方括号中的名字[]
SELECT ship from Outcomes otr
WHERE EXIST(select ship from Outcomes inr
where inr.ship=otr.ship
)
或
SELECT ship from Outcomes [outer]
WHERE EXIST(select ship from Outcomes [inner]
where [inner].ship=[outer].ship
)
的squery bracktes只有工作,如果你使用的是SQL服务器
SELECT ship from Outcomes o1
WHERE EXISTS(select ship from Outcomes o2
where o2.ship = o1.ship)
外部和内部都是保留字。使用别的东西! (或双引号,例如"outer"
。)另外,它是EXISTS
,而不是EXIST。
外部和内部都是保留字。使用别的东西! (或者双引号,例如“outer”。)另外,它的EXIST,不是EXIST – jarlh