What Is Wrong With This MySQL Drop Column From Table Syntax ?

HTML, CSS, Javascript, php, C++, C# , Java and other Programming Language Discussion
Post Reply
Junior
Posts: 21
Joined: August 1st, 2018, 8:41 am
Cash on hand: 400.00
Gender: M
full name:

What Is Wrong With This MySQL Drop Column From Table Syntax ?

#1

Post by Junior » August 24th, 2019, 1:09 am

I need a syntax that will drop column from a table of database in mysql

the syntaxto drop from a table is ALTER TABLE hello COLUMN USER1;

My database name is ddbase, how can I select the database from the syntax instead of clicking on the database first.

I used this syntax

ALTER TABLE ddbase.hello DROP COLUMN USER1;

I got this error Can't DROP 'USER1'; check that column/key exists

(Quote)




SHARE WITH FRIENDS




solomon
Active Member
Active Member
Posts: 67
Joined: December 25th, 2017, 11:50 am
Cash on hand: 3,079.00
Gender: M
full name:

What Is Wrong With This MySQL Drop Column From Table Syntax ?

#2

Post by solomon » August 31st, 2019, 5:02 pm

Your syntax is correct

ALTER TABLE databasename.table DROP COLUMN columnname;

You should probably check if you refer to the column name correctly

(Quote)








  •  LOGIN
    • SUGGESTED TOPICS
    • Table
      Title1
      Title2

      Text11
      Text21

      Text12
      Text22

      Text13
      Text23