Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> problem with 'create table xxx as <query>' with order by clause
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
--
* * * * * * * * * * * * * * * *
![]() |
![]() |