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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Sorting in Oracle7.3

Re: Sorting in Oracle7.3

From: Sjefke <Sjefke_at_4.president>
Date: 10 Jun 1998 15:08:21 GMT
Message-ID: <6lm7h5$4k1$1@hdxf08.telecom.ptt.nl>


Hi Gregory,

Try something like:

CREATE TABLE not_sorted (FIELD1, FIELD2) AS
SELECT FIELD1, FIELD2
FROM sorted
GROUP BY FIELD1, FIELD2; Group by can be 'mis-used'as a order by because it implicitly orders the data. Note that even if you want to sort only on FIELD1 you still have to include all other fields you select in the group by clause.

hope this helps !!

"Gregory Rapone" <grapone_at_ims-global.com> schrijfbewerkingen: > I want to create a table that is in a sorted format based on the results of
> a sorted sub query. I know that the ORDER BY clause cannot appear in
> subqueries within other statements, but I want the valid equivalent to :
>
> CREATE TABLE not_sorted (FIELD1, FIELD2)
> AS
> SELECT FIELD1, FIELD2
> FROM sorted;
>
> many thanks,
> Greg.
>
>
>
Received on Wed Jun 10 1998 - 10:08:21 CDT

Original text of this message

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