Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Complex ORDER BY clauses
Matthias Wirtz wrote:
> "Daniel Morgan" <damorgan_at_x.washington.edu> schrieb im Newsbeitrag
> news:1068849441.169822_at_yasure...
>
>>mcstock wrote:
>>>| SELECT test_col >>>| FROM ( >>>| SELECT test_col >>>| FROM t >>>| ORDER BY test_col) >>>| ORDER BY DECODE(test_col, 'B', 1, 'E', 2, 99);
>>>why the double order by?
>>The original wanted everything ordered with B and E pulled out. The >>entire set must be ordered first. The outer query only changes the >>value of the two selected values.
Because most likely you entered ordered information. Enter it disordered. Or more like the real world ... enter is disordered and then perform multiple updates.
Then try the statements. The ORDER BY is essential.
Or at least some operation that implicitly orders such as a GROUP BY clause.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Sat Nov 15 2003 - 17:01:35 CST