For MySQL it is not: MySQL Feature Request .
In any case, allowing this may be a really bad idea: IF EXISTS indicates that you are performing destructive operations on a database with (for you) an unknown structure. There may be situations where it is acceptable for fast and dirty local work, but if you are tempted to make such a statement against production data (during migration, etc.), you play with fire.
But if you insist, it is easy to first check for the presence in the client or to catch an error.
MariaDB also supports the following, starting with 10.0.2:
DROP [COLUMN] [IF EXISTING] col_name
those.
ALTER TABLE my_table DROP IF EXISTS my_column;
But it might be a bad idea to rely on a non-standard function supported by only one of several MySQL forks.
MattW. Oct 6 '08 at 10:31
source share