【发布时间】:2008-10-29 19:12:16
【问题描述】:
当我运行这个查询时,Oracle 给我一个错误(ORA-00907:缺少右括号):
select *
from reason_for_appointment
where reason_for_appointment_id in
(
select reason_for_appointment_id
from appointment_reason
where appointment_id = 11
order by appointment_reason_id
)
但是,当我只运行子查询时,没有错误。
谁能解释一下问题出在哪里?
【问题讨论】:
-
您这样做的原因是什么?排序应该是不必要的操作,因为 Oracle 索引将在幕后执行此操作。
-
什么?在幕后做什么?为什么它会对索引做任何事情?