List:General Discussion« Previous MessageNext Message »
From:Thimble Smith Date:August 30 1999 7:41am
Subject:Re: How to use two column as a primary key?
View as plain text  
At 15:38, 19990830, hgz wrote:
>I want to use two column of a table as a primary key,
>what should I do?
>CREATE TABLE user1 (
>  userid varchar(8) binary DEFAULT '' NOT NULL,
>  id varchar(30) binary DEFAULT '' NOT NULL,
>  username varchar(30) DEFAULT '' NOT NULL,
>  userpassword varchar(25) binary DEFAULT '' NOT NULL,
>  useremail varchar(70) binary DEFAULT '' NOT NULL,
>  groups varchar(25) DEFAULT '' NOT NULL,
>  userprofile text NOT NULL,
>  PRIMARY KEY (id,userid)
>);
>could it work?

Yes, it works just like that.  Why did you need to ask us?  :)  If
it doesn't work the way you expect, then tell us what you expect and
we can re-educate you.

Tim
Thread
How to use two column as a primary key?hgz30 Aug
  • Re: How to use two column as a primary key?Thimble Smith30 Aug