A.Sunil Kumar
A.Sunil Kumar

Reputation: 59

DELETE complete column from table

[Name] [major_version] [minor_version] [revision] [install_failures]

   s       23                1            NULL           0

This is my table. How can I delete the revision column (not the value, the complete revision column) from table?

Upvotes: 0

Views: 369

Answers (5)

Android
Android

Reputation: 9023

This is very simple...use this

ALTER TABLE table_name DROP COLUMN column_name

Here are some links that will help you.

techonthenet, w3schools, php.about, sqlzoo.

Upvotes: 0

painotpi
painotpi

Reputation: 6996

You have to use the alter table statement to delete the revision column from your table.

The ALTER TABLE statement is used to add, delete, or modify columns in an existing table.

your delete column syntax will look like this

ALTER TABLE table_name
DROP COLUMN revision

Upvotes: 0

Saurabh Gokhale
Saurabh Gokhale

Reputation: 46405

Use ALTER statement

ALTER TABLE table_name DROP COLUMN revision;

The ALTER TABLE statement is used to add, delete, or modify columns in an existing table.

Syntax :

ALTER TABLE table_name
DROP COLUMN column_name

Upvotes: 2

Wessel Kranenborg
Wessel Kranenborg

Reputation: 1440

You can do this with the following sql

ALTER TABLE table_name
DROP COLUMN revision

Here can you read simple documentation on that.

Upvotes: 3

Nico Huysamen
Nico Huysamen

Reputation: 10417

ALTER TABLE `table_name` DROP COLUMN `revision`;

Upvotes: 5

Related Questions