Re: How can I drop a column from a table?

From: Henri M.B. van den Bulk <hvdbulk_at_lgc.com>
Date: 1996/07/31
Message-ID: <31FF639C.4487_at_lgc.com>#1/1


Jarmo Tuominen wrote:
>
> What is the best way to drop a column from the table? Is there any command for this?
>
> Jarmo Tuominen

There is not realy a command that will drop a column. The best thing to do is to create a copy of the table then drop the original one and rename the copy.

	CREATE TABLE tmp_table AS 
        SELECT columns (without the one you want to drop)
	  FROM original_table;

	DROP original table

	RENAME tmp_table TO original_table

Remember that if you have triggers on you original table, that you have to recreate them.

Hope this helps.

-- 
 Henri M.B. van den Bulk                http://tulsix.utulsa.edu/~hvdbulk/
 Landmark Graphics Corp.,               
 Drilling & Well Services Product Group
Received on Wed Jul 31 1996 - 00:00:00 CEST

Original text of this message