I have the following query:
ALTER TABLE table CHANGE field1 field1 INTEGER
Is there anyway that I can add some sort of if exists to this statement so that MySQL will make sure that field 1 exists before attempting to change its field type?
I have the following query: ALTER TABLE table CHANGE field1 field1 INTEGER Is there
Share
ALTER TABLEin MySql does not take anIF EXISTSclause.You can do a
or
to get the list of all columns and then check if field1 is present before you do a
ALTER TABLE