Please help me to create index between two tables in mysql? I have "account" and "group" table. I have to index with "group_id with index_id" and to be unique.
-
2This question has absolutely nothing to do with PHP.Lightness Races in Orbit– Lightness Races in Orbit2011-01-13 16:47:20 +00:00Commented Jan 13, 2011 at 16:47
-
What do you mean, precisely, by "be unique" ?Victor Nicollet– Victor Nicollet2011-01-13 16:47:29 +00:00Commented Jan 13, 2011 at 16:47
Add a comment
|
3 Answers
MySQL table indexes are on single tables.
Perhaps you're thinking of a FOREIGN KEY, which is only available with the InnoDB storage engine.
Comments
I just learned this myself, here, but apparently if you create a Unique constraint on a field, mySql will automatically create a nonclustered index on that field.