how to delete content of column?

how to delete content of column?

am 01.03.2006 10:21:20 von secretspot

Hello group,

I want to delete the content of a single column on a MySQL 3.23
database. Tried
DELETE column_name FROM table_name;
and other varieties with e.g. WHERE clause. No luck until now.

The above statement gives the error msg:
ERROR 1066: Not unique table/alias: column_name

How to get rid of the content of a certain column?

Thanks for any hint.
Saludos,
George

Re: how to delete content of column?

am 01.03.2006 11:47:55 von secretspot

OK, it seems that DELETE command just deletes content of a whole table.
Is it possible to delete a specific column?

- George

Re: how to delete content of column?

am 01.03.2006 12:22:31 von secretspot

Is it recommended to overwrite all entries with an empty string value
(''), or NULL?
e.g. UPDATE table_name SET column_name='';

Re: how to delete content of column?

am 01.03.2006 15:39:37 von gordonb.i7cr2

>I want to delete the content of a single column on a MySQL 3.23
>database. Tried
>DELETE column_name FROM table_name;
>and other varieties with e.g. WHERE clause. No luck until now.
>
>The above statement gives the error msg:
>ERROR 1066: Not unique table/alias: column_name
>
>How to get rid of the content of a certain column?

Do you want to get rid of the COLUMN, or the CONTENT?

alter table table_name drop column_name;

does the first. If you want the second, a column has to
have *something* in it, even if it's null. Perhaps you want

update table_name set column_name = null;

Gordon L. Burditt