|
-
You can't use order by in an insert statement:
[email protected]> insert into table_b select * from table_a
2 order by 1
3 /
order by 1
*
ERROR at line 2:
ORA-00933: SQL command not properly ended
[email protected]> desc table_a
Name Null? Type
----------------------------------------- -------- ----------------------------
D VARCHAR2(20)
E DATE
F VARCHAR2(20)
[email protected]> drop table table_b;
Table dropped.
[email protected]> create table table_b as select * from table_a order by d;
Table created.
[email protected]> select * from table_b;
D E F
-------------------- --------- --------------------
3607551298 30-JAN-50 3111188
3607551428 30-JAN-50 2160118
3607551428 30-JAN-50 2160118
3607551428 30-JAN-50 2160118
3607551484 30-JAN-50 3934798
3607551484 30-JAN-50 3934798
3607551484 30-JAN-50 3934798
7 rows selected.
[email protected]> select * from table_a
2 /
D E F
-------------------- --------- --------------------
3607551428 30-JAN-50 2160118
3607551484 30-JAN-50 3934798
3607551428 30-JAN-50 2160118
3607551484 30-JAN-50 3934798
3607551298 30-JAN-50 3111188
3607551428 30-JAN-50 2160118
3607551484 30-JAN-50 3934798
7 rows selected.
Jeff Hunter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|