RE: 4 fields to form key

2001-08-23 Thread Don Read
On 23-Aug-2001 Tim Cowan wrote: > Hi > > Is it possible to use 2 or more fields to become the primary key. I have a > table > > CREATE TABLE tmptraining ( > rowid int(10) unsigned NOT NULL auto_increment, > sid char(32) NOT NULL default '', > expiry date NOT NULL default '-00-00', >

Re: 4 fields to form key

2001-08-23 Thread joseph . bueno
Tim Cowan wrote: > > Hi > > Is it possible to use 2 or more fields to become the primary key. I have a > table > Yes > CREATE TABLE tmptraining ( > rowid int(10) unsigned NOT NULL auto_increment, > sid char(32) NOT NULL default '', > expiry date NOT NULL default '-00-00', > arena

Re: 4 fields to form key

2001-08-23 Thread Jason G.
I am not sure about the primary key. You can create a UNIQUE index on (field1, field2, field3, field4)... (I have done this) This will prevent any duplicate rows from being inserted. Hope it Helps, -Jason Garber Lead Programmer - pulseaday.com At 08:07 AM 8/23/2001 -0400, you wrote: >Hi > >I