Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Create table as ...
The order by <expression> should also be part of the select statement.
On 20 Jan 1998 10:28:27 GMT, "joachim Carlsson" <joachim.carlsson_at_neurope.ikea.com> wrote:
>You have to create a table something like
>
>create table a as select * from b where 2=1;
>insert into a select * from b order by something;
>
>/Joachim
>
>Wei Tang <wtang_at_cs.ualberta.ca> wrote in article
><69ovpt$qdj$1_at_scapa.cs.ualberta.ca>...
>> Hi, there:
>>
>> I wonder if anyone of you ever used "create table as subquery" statement
>> to create a table.
>>
>> I have a table called test:
>> create table test(
>> name varchar2(10),
>> ID number);
>>
>> But I cannot use the following statement:
>> create table test_bak as select * from test order by ID;
>>
>> It said: ORA-00933: SQL command not properly ended.
>>
>> When I remove the "order by" clause, everything is fine. I couldn't find
>> any documentation saying "order by" is not supported in "create table
>> as..." statement.
>>
>> What's wrong with that?
>>
>> I need your expertise in a rush. Please help me.
>>
>> Thanks.
>>
>>
Kaboel Karso
Consultant
\\\|/// \\ ~ ~ // ( @ @ ) ==========================-oOOo-(_)-oOOo-=================== eSCOSYS Consultancy Phone : +31 (0)32 024 7285 Horst 2827 Fax : +31 (0)32 024 7286 8225 MZ Lelystad Mobile : +31 (0)65 498 5413 The Netherlands email : kkarso_at_knoware.nl ==================================-Oooo.-=================== .oooO ( ) ( ) ) / \ ( (_/Received on Tue Jan 20 1998 - 00:00:00 CST
![]() |
![]() |