Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Insert from another table...
You cannot use order by clause in a select statement that you want to use it with the insert. The order in which oracle retrieves records does not depend on the order in which you inserted. Even you sort your records while inserting, The ROWID's of these inserted records may not be in this order. While selecting data, Oracle will let you sort the records through its ORDER BY clause in the select statement.
-- Vijaya Kumar Vardhineni Certified Oracle DBA, EDS Plano, TX L. Tseng <lesliet_at_u.washington.edu> wrote in article <5bp2pv$n4l_at_nntp1.u.washington.edu>...Received on Sat Jan 18 1997 - 00:00:00 CST
>
> Orcale does not take ORDER BY clause in the following insert
> syntax. Do you know why? Any suggestion on workaround?
> Thanks,
> Leslie
>
> insert into table_a (col1, col2,col3)
> select x, y, z from table_b
> order by x
>
>