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: problem with 'create table xxx as <query>' with order by clause

Re: problem with 'create table xxx as <query>' with order by clause

From: Glen E. Siferd <siferd_at_admin.uwex.edu>
Date: Fri, 23 Jul 1999 15:51:46 -0500
Message-ID: <7nanps$ag8$1@news.doit.wisc.edu>


Don't think you can work around it. Oracle doesn't allow you to use the "order by" clause because physical storage order cannot be guaranteed in relational tables. Only on retrieval.

Paul Wagner <wagner_at_tera.cs.umn.edu> wrote in message news:7nak20$e67$1_at_news1.tc.umn.edu...
> Working with Oracle 7.3.2. I just noticed that 'create table temp as
> select field from table order by field' does not work - generates an
> 'SQL command ended improperly' error. Of course, the plain 'select
> field from table order by field' works fine, as does the above create
> table statement if you remove the order by clause.
>
> I found one workaround - 'create table temp as select field from table
> group by field', as Oracle orders the groups in ascending order, which
> is what I want now. This won't work for descending order, though. Anyone
> know of a workaround that allows me to use "order by" in a "create table"
> statement?
>
> Thanks,
>
> Paul
>
>
> --
> * * * * * * * * * * * * * * *
*
> * Paul J. Wagner School - wagner_at_cs.umn.edu
*
> * Computer Science Department Work - wagnerp_at_uwstout.edu
*
> * University of Minnesota

* Received on Fri Jul 23 1999 - 15:51:46 CDT

Original text of this message

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