Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: ORDER BY 1

Re: ORDER BY 1

From: Howard J. Rogers <howardjr2000_at_yahoo.com.au>
Date: Sat, 3 Aug 2002 17:30:37 +1000
Message-ID: <aig1mn$6sk$1@lust.ihug.co.nz>

"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message news:vsumkug0cmi715rr6mv1turjhe3639pi1l_at_4ax.com...
> On Sat, 3 Aug 2002 15:47:10 +1000, "Howard J. Rogers"
> <howardjr2000_at_yahoo.com.au> wrote:
>
> >It *should* mean 'order by the first column of the table':
>
> Sorry to say so, but this is incorrect.
> order by n means : order by the <n>th *expression* in the select list,

...which, in the examples I gave, is the first column of the table.

> NOT by the <n>th *column* in the table.
> Please run
> select ename||'!', empno from emp
> order by 1
>
> By which expression does it order?

By the first expression in the select list, as expected... which means you were right. As was I (my 'first expressions' happened also to be my first columns).

You are more generic than I, and in a multi-table select, or where it gets fancy, your definition is preferable. Agreed.

Doesn't mean I wasn't also correct, given the examples I posted, however.

Regards
HJR
>
> Regards
>
>
> Sybrand Bakker, Senior Oracle DBA
>
> To reply remove -verwijderdit from my e-mail address
Received on Sat Aug 03 2002 - 02:30:37 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US