Hi There,
i want to create a table (mytable) with three fields:
sid varchar(255) id int type int
However I want the 'id' field to be unique... I don't want it to by the primary key though. How do I use the "UNIQUE" command to get this to happen?
Basically the same SID can enter many 'ids' into the table - but each 'id' must be different. Different SIDs can enter the same 'ids'.
Thanks!
use a primary key of sid AND id.
I'm kinda new to this... could you please tell me how this works.
Normally I would just type:
CREATE TABLE mytable (sid varchar(255),id int,type int)
And work from there.
have you checked -any- sql documentation yet?!
primary key (field1, field2) will create a duel column'd primary key.
rtfm. I'm pretty sure this same convention is used across nearly every database.