MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Bruce Douglas Date:May 25 2003 2:52am
Subject:RE: create table question....
View as plain text  
forget the question...

a typo as usual....

thanks..


-----Original Message-----
From: Bruce Douglas [mailto:bedouglas@stripped]
Sent: Saturday, May 24, 2003 6:58 PM
To: 'MySql'
Subject: create table question....


Hi...

I'm trying to create a simple table with a unique ID, and a unique name. I
tried to create the following table:
 CREATE TABLE ItemTbl
 (
  id int(11) NOT NULL auto_increment,
  itemname        varchar(25)     NOT NULL default '',
  unique (itemname),
 )TYPE=MyISAM;

It generated the following error.....
	ERROR 1075: Incorrect table definition; There can only be one auto column
and it must be defined as a key

Any idea as to how I can have a table with an auto incrementing ID, and
guarantee that the name is unique. I'd also like to be able to use the ID as
the primary key....


thanks

bruce
bedouglas@stripped



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=1

Thread
foreign key help neededCato Liberty24 May
  • Upgrade troublesScott Haneda25 May
    • Re: Upgrade troublesMartin Gainty25 May
      • Re: Upgrade troublesScott Haneda25 May
      • create table question....Bruce Douglas25 May
        • RE: create table question....Bruce Douglas25 May
Re: foreign key help neededHeikki Tuuri25 May