Reputation: 302
how can it?
I found it for check column exists
(
SELECT 1 FROM Information_schema.columns
WHERE table_schema = 'db'
AND table_name = 'table'
AND column_name = 'the other column'
)
and add the column after the other column
ALTER TABLE 'table' ADD 'the column' VARCHAR(14) DEFAULT NULL AFTER 'the other column'
Upvotes: 0
Views: 152
Reputation: 587
give the name of the db in which the table exists:-
ALTER TABLE db.table ADD the_column VARCHAR(14) DEFAULT NULL AFTER the_other_column
It worked for me try this and let me know where it is failing
Upvotes: 2