当我运行此查询时,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 )
但是,当我只运行子查询时,没有错误.
任何人都可以解释问题是什么?
内部查询结果将永远不会显示,因此在嵌套选择中执行顺序没有意义.而是将其应用于外部查询.