rsp
ORA-00933:SQL命令未正确结束
我在oracle上运行此命令时出现此错误,有人可以帮我解决此错误吗?
答案 0 :(得分:0)
你混淆了使用having子句和where子句。
在SQL中添加了having子句,因为WHERE关键字不能与聚合函数一起使用。
有关详细信息,请查看: http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_10002.htm#i2130020
答案 1 :(得分:0)
您的where
子句位置错误,请尝试
select loc
from emp e, dept d
where e.deptno != d.deptno
having count(e.deptno) = 0 or sal <= min(sal) and d.dname = 'SALES' and count(ename) >= 2 and sal < avg(sal)
group by loc
;