On 6/29/2010 9:24 AM, Victor Subervi wrote:
Hi;
I have the following:

create table pics (
   picture_id int auto_increment primary key,
   product_sku int not null primary key,
   picture_num int not null,
   picture_desc varchar(100),
   picture_data longblob
);

which doesn't work I need to auto_increment and declare primary key on two
fields. How do?
TIA,
Victor


Use the other syntax for defining keys:

create table pics (
   picture_id int auto_increment,
   product_sku int not null,
   picture_num int not null,
   picture_desc varchar(100),
   picture_data longblob,
   PRIMARY KEY(product_sku_int, picture_id)
);

--
Shawn Green
MySQL Principle Technical Support Engineer
Oracle USA, Inc.
Office: Blountville, TN

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

Reply via email to