Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

Determinando se o índice da tabela MySQL existe antes de criar

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