1. Home
  2. Computing & Technology
  3. PHP / MySQL
photo of Angela Bradley
Angela's PHP / MySQL Blog

By Angela Bradley, About.com Guide to PHP / MySQL

Drop Column in MySQL

Wednesday November 15, 2006
You can remove an entire column from a MySQL database by using the drop column command. This also removes all data from the column when it is removed.
Comments
March 22, 2007 at 8:20 am
(1) ashok says:

give the example to drop column

November 26, 2007 at 4:44 pm
(2) evolutionxbox says:

It doens’t work…

I wrote:
ALTER TABLE T1 DROP DOB;

My tables is called T1 and my column is DOB for Date Of Birth.

I get:
ERROR: parser: parse error at or near “;”

I am using SSH Secure Shell 3.2.9, what is going on?

July 9, 2009 at 1:41 am
(3) suraj says:

You just have to use

alter table t1 drop column dob

July 20, 2009 at 12:43 am
(4) Phani says:

How to delete more than one field from table

November 7, 2009 at 11:52 pm
(5) arjun reddy says:

how to drop a column which is a foreign key.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL

©2009 About.com, a part of The New York Times Company.

All rights reserved.