Thread: Is there a way to drop a column?

Is there a way to drop a column?

From
"G. Anthony Reina"
Date:
Somehow some columns from one of my tables "melded" with another table.
I'm trying to figure out how this happened, but in the meantime, I'd
like to be able to delete the extra columns in the table.

I can see a way to "alter table ... add column". Is there a way to
"alter table ... drop column"?

Thanks.
-Tony



Re: Is there a way to drop a column?

From
Karel Zak
Date:
On Tue, 30 May 2000, G. Anthony Reina wrote:

> Somehow some columns from one of my tables "melded" with another table.
> I'm trying to figure out how this happened, but in the meantime, I'd
> like to be able to delete the extra columns in the table.
>
> I can see a way to "alter table ... add column". Is there a way to
> "alter table ... drop column"?

 SELECT without_a_column INTO xxx FROM tab;
 DROP TABLE tab;
 ALTER TABLE xxx RENAME TO tab;

 OK?

                    Karel


Re: Is there a way to drop a column?

From
"G. Anthony Reina"
Date:
Karel Zak wrote:

>
> > I can see a way to "alter table ... add column". Is there a way to
> > "alter table ... drop column"?
>
>  SELECT without_a_column INTO xxx FROM tab;
>  DROP TABLE tab;
>  ALTER TABLE xxx RENAME TO tab;
>

Thanks. That worked.

-Tony



Re: Is there a way to drop a column?

From
Joseph Shraibman
Date:
Karel Zak wrote:
>
> On Tue, 30 May 2000, G. Anthony Reina wrote:
>
> > Somehow some columns from one of my tables "melded" with another table.
> > I'm trying to figure out how this happened, but in the meantime, I'd
> > like to be able to delete the extra columns in the table.
> >
> > I can see a way to "alter table ... add column". Is there a way to
> > "alter table ... drop column"?
>
>  SELECT without_a_column INTO xxx FROM tab;
>  DROP TABLE tab;
>  ALTER TABLE xxx RENAME TO tab;
>
>  OK?
>
I could have sworn this was supposed to be added into version 7.  Did
they just make "alter table drop column" into a alias for using a temp
table?