MySQL Forums
Forum List  »  Newbie

Re: Problem creating table with 2 primary keys
Posted by: Keith Larson
Date: June 17, 2013 08:02PM

"only one auto column and it must be defined as a key"

based on what you put in try this:

CREATE TABLE album (
album_id INT(4) NOT NULL AUTO_INCREMENT,
artist_id INT(5) NOT NULL,
album_name varchar(128) DEFAULT NULL,
PRIMARY KEY (album_id) ,
UNIQUE KEY `aid` (`artist_id`)
);

Just trying to help....

http://anothermysqldba.blogspot.com

Options: ReplyQuote




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.