Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Delete column(s) from a table
Patrick C. K. Wu wrote:
>
> Hi all
>
> Could anyone tell me how to delete column(s) from a table using SQL
> statement?
What you would like to do is this: alter table drop column <column>;
Unfortunately, that command doesn't exist. You have to copy the table out to a new table, recreate the old table without the offending column, then copy it back. There are many ways to do this - copy command, create table as select from, etc. But I don't think export/import will work because the import will try to insert into the old column which isn't there anymore.
It's really a hassle so we avoid it by just ignoring the column and not populating it any more. If a convenient time presents itself, we would reorg the table then and get rid of the column. It's up to you as to whether it's worth the trouble or you have the time to do it. from,
-- --- Allen Kirby AT&T ITS Production Services akirby_at_att.com Alpharetta, GA.Received on Tue May 06 1997 - 00:00:00 CDT
![]() |
![]() |