Mysql
 sql >> Base de données >  >> RDS >> Mysql

Déterminer si l'index de table MySQL existe avant de créer

SELECT INDEX_NAME FROM INFORMATION_SCHEMA.STATISTICS WHERE
`TABLE_CATALOG` = 'def' AND `TABLE_SCHEMA` = DATABASE() AND
`TABLE_NAME` = theTable AND `INDEX_NAME` = theIndexName