if-not-exists is a common SQL condition used to check if an entity exists.

learn more… | top users | synonyms

9
votes
2answers
10k views

MySQL: Create index If not exists

Is there a way to create an index in MySQL if it does not exist? MySQL does not support the obvious format: CREATE INDEX IF NOT EXISTS index_name ON table(column) ERROR 1064 (42000): You have an ...