• support@answerspoint.com

How to create add indexes to MySQL tables

1751

How to create  add indexes to MySQL tables

I want to create and add  an unique index composed with more than one field using sql command in mysl databse 

  • Mysql

  • asked 9 years ago
  • Sunny Solu

2Answer


0
ALTER TABLE `table` ADD INDEX `product_id` (`product_id`)

Never compare integer to strings in mysql. If id is int = remove the quotes.

  • answered 8 years ago
  • Sunny Solu

0
ALTER TABLE TABLE_NAME ADD INDEX (COLUMN_NAME);
  • answered 8 years ago
  • Sunny Solu

Your Answer

    Facebook Share        
       
  • asked 9 years ago
  • viewed 1751 times
  • active 9 years ago

Best Rated Questions