Snehal Parmar
Snehal Parmar

Reputation: 5823

mysql index creating issue

I have deleted all the data from an existing table and then trying to alter table using the following query in mysql:

 ALTER TABLE mytable ADD INDEX (created_on);

but nothing seems to working, it just keep running with out any result.

Upvotes: 1

Views: 30

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269443

Here is a correct way to add an index:

create index idx_mytable_createdon on mytable(created_on);

Upvotes: 1

Related Questions