SELECT * from table1 where column1 IN (SELECT column1 from table1 ORDER BY column1);
You cannot use an order by
clause in a query that's used with the in
operator. I'm guessing the reason to deny its use is because it would be pointless - an in
condition should return true if the left-hand side operand is present in the result of the right hand side query, regardless of its relative position in the result. So allowing you to use an order by
clause there would leave Oracle's developers with one of two unappealing choices:
order by
clause.Neither of these options fit well to Oracle Database's mindset, so I'm guessing the easiest thing would be to just block this option.