Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: About ordering in SQL
In article <PyGt5.10147$oL4.210919_at_news2.nokia.com>,
"Artti Jaakkola" <artti.jaakkola_at_novostore.com> wrote:
> If I make following query:
>
> SELECT
> ID
> FROM
> SOMETABLE
> WHERE
> ID IN (1, 4, 6, 2)
>
> ID
> --
> 2
> 6
> 4
> 1
>
> Is the result always ordered like this or is there some better way to
do it?
>
> --
> - Artti -
After the "where" statement add:
Order by ID
or
Order by 1
Ascending is the default but you could say "Order by 1 DESC" for descending.
When selecting multiple attributes, ordering by Number is much easier than typing in all the names and it avoids another potential source of errors.
Ken_hansen>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Sep 07 2000 - 03:46:02 CDT
![]() |
![]() |