Oracle ORA-00933:SQL命令未正确结束00933。00000-“SQL命令未正确结束
当我执行上述两个查询时,它显示SQL命令没有正确结束,可能是因为它们无效;它们是什么 ;除和以外的所有红色部分 另一个供应商 应该做什么?注释,也许?在Oracle中,您应该使用-或将注释括在/*…*/ 这可能更好一些: 第一个问题:Oracle ORA-00933:SQL命令未正确结束00933。00000-“SQL命令未正确结束,oracle,oracle11g,Oracle,Oracle11g,当我执行上述两个查询时,它显示SQL命令没有正确结束,可能是因为它们无效;它们是什么 ;除和以外的所有红色部分 另一个供应商 应该做什么?注释,也许?在Oracle中,您应该使用-或将注释括在/*…*/ 这可能更好一些: 第一个问题: Select S.sname From suppliers s where not exists ( (select * from parts p where p.color = 'red') ; all red parts except (select
Select S.sname
From suppliers s
where not exists (
(select * from parts p where p.color = 'red') ; all red parts
except
(select c.pid from catalog c, parts p where c.sid = s.sid
and c.pid = p.pid and p.color = 'red'))
select p.pname
from parts p. catalog c, suppliers s
where p.pid = c.pid and c.sid = s.sid
AND s.sname = 'S1'
AND not exists ( # another supplier
select * from catalog c1, suppliers s1
where p.pid = c1.pid and c1.sid = s1.sid
AND s1.sname <> 'S1')
第二个问题:
Select S.sname
From suppliers s
where not exists ( (select *
from parts p
where p.color = 'red'
)
minus
(select c.pid
from catalog c, parts p
where c.sid = s.sid
and c.pid = p.pid
and p.color = 'red'
)
);
您需要使用;加上嵌入的;终止每个语句,所有红色部分和“另一个供应商”也都是错误的,Oracle的SQL中没有例外。注释是通过两个破折号执行的-仅对一行,通过/**/对多行,而不是通过或;
select p.pname
from parts p, catalog c, suppliers s
where p.pid = c.pid
and c.sid = s.sid
AND s.sname = 'S1'
AND not exists (select *
from catalog c1, suppliers s1
where p.pid = c1.pid
and c1.sid = s1.sid
AND s1.sname <> 'S1'
);