Juan Carlos Castro y Castro wrote:
Why UNIQUE KEY? Wouldn't PRIMARY KEY be better?
CREATE TABLE dbaliases (
alias_username varchar(64) default '' NOT NULL,
alias_domain varchar(128) default '' NOT NULL,
username varchar(64) default '' NOT NULL,
domain varchar(128) default '' NOT NULL,
UNIQUE KEY alias_key (alias_username,alias_domain),
INDEX alias_user (username, domain)
);
...
Unique Key Column(s) value(s) must be unique in table or null (see
note below)
Primary Key UK + Not Null which equates to every column in the key
must have a value and this value is unique so the PK
uniquely identifies each and every row in the table
...
Thus I suggest you are right.
regards
klaus
_______________________________________________
Users mailing list
Users(a)openser.org
http://openser.org/cgi-bin/mailman/listinfo/users