Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: rename a column
> CREATE TABLE temptable AS
> SELECT * FROM existingtable;
>
> DROP TABLE exisitingtable;
>
> CREATE TABLE (new definitions and column names);
>
> INSERT INTO existingtable
> SELECT * FROM temptable;
>
> DROP TABLE temptable;
Something a little quicker is the following:
CREATE TABLE newtable AS
SELECT col1, col2, col3 newcol, col4 . . .
FROM oldtable;
DROP TABLE oldtable;
RENAME newtable TO oldtable; Received on Thu Feb 08 2001 - 12:55:17 CST
![]() |
![]() |