MySQL Forums
Forum List  »  General

Re: creating InnoDB table with primary key with multiple columns and auto increment
Posted by: Fausto Astudillo
Date: July 23, 2005 10:11AM

You MUST define the auto_increment column a an index.

CREATE TABLE test (
id INT NOT NULL,
id1 INT NOT NULL auto_increment,
last_name CHAR(30) NOT NULL,
first_name CHAR(30) NOT NULL,
PRIMARY KEY (id,id1),
KEY name (last_name,first_name))
/** Add this instruction **/
KEY UNIQUE autoid1 (id1)

type=InnoDB
;

Options: ReplyQuote


Subject
Written By
Posted
Re: creating InnoDB table with primary key with multiple columns and auto increment
July 23, 2005 10:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.