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: And the correct answer is?

Re: And the correct answer is?

From: andrewst <member14183_at_dbforums.com>
Date: Fri, 04 Apr 2003 12:12:06 +0000
Message-ID: <2729053.1049458326@dbforums.com>

Originally posted by sandijs
> You are wrong here. When you say "ORDER BY 1" it means you want to
> order by first column of resultset and "ORDER BY 2" = order by second
> column and so on.
>
> Sandijs
> OCP DBA,
> Riga, Latvia
>

Originally posted by Mikito Harakiri
> "1" is just a constant function (or constant expression), so that
>
> SELECT empno, ename FROM emp ORDER BY 1
>
> must be equivalent to
>
> SELECT empno, ename FROM emp ORDER BY 2
>
> and to just
>
> SELECT empno, ename FROM emp
>

>

I think Mikito meant that "1" OUGHT to be treated as a constant in the ORDER BY clause rather than IS, i.e. was criticising the functionality - but he didn't make that clear, and gave the impression he meant it would not work rather than should not.

--
Posted via http://dbforums.com
Received on Fri Apr 04 2003 - 06:12:06 CST

Original text of this message

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