SQL缺少右括号
我没有神经了 代码如下:SQL缺少右括号,sql,Sql,我没有神经了 代码如下: select o.embg from objekti o where o.embg not in ( select s.embg, t.time from objekti o, sopstvenici s, tipovi t where o.embg = s.embg and o.tid = t.tid and t.time = 'Куќа' order by o.embg ) 导致错误: 0RA-00907
select o.embg from objekti o
where o.embg not in (
select s.embg, t.time
from objekti o, sopstvenici s, tipovi t
where o.embg = s.embg and o.tid = t.tid and t.time = 'Куќа'
order by o.embg
)
导致错误:
0RA-00907:缺少右括号
我的错误在哪里?你不能把
按顺序
放在括号内。将其上移到第二个WHERE
子句后的上一行末尾。不能将ORDER BY
放在括号内。将其上移到第二个WHERE
子句后的上一行末尾。那么,您不能在该子选择中返回两列(因为您想将其与embg
字段进行比较)。此外,您不关心子选择的顺序。试试这样吧
select o.embg from objekti o where o.embg not in (select s.embg from
sopstvenici s,tipovi t where o.embg=s.embg and
o.tid=t.tid and t.time='Куќа')
order by o.embg
嗯,您不能在该子选择中返回两列(因为您希望将其与
embg
字段进行比较)。此外,您不关心子选择的顺序。试试这样吧
select o.embg from objekti o where o.embg not in (select s.embg from
sopstvenici s,tipovi t where o.embg=s.embg and
o.tid=t.tid and t.time='Куќа')
order by o.embg
此外,“not in”语句不能与返回多个字段的“select”语句一起使用,对吗。我在子查询中错过了t.time。此外,“not in”语句不能与返回多个字段的“select”语句一起使用,对吗?也是。我错过了子查询中的t.time。