I have a primary key set on a table which consists of the combination of
the
values: firstname, lastname, and a schedule_id (BIGINT(20))... I have this
so the records in this table do not have duplicates, being that no one
record should have the exact same name and schedule_id identifier.
You will have to UPDATE to NULL those fields, modify the aplication to
enter NULL instead of empty-string... Then add the UNIQUE INDEX...
In MySQL (unless modified) the dafault is that NULL values are
incomparable thus allowing the creation of a UNIQUE INDEX.
-- -- -- -- -- -- -- -- -- -- -- --
right...
- Original Message -
From: Gabriel PREDA [EMAIL PROTECTED]
To: Ferindo Middleton [EMAIL PROTECTED]
Cc: Dan Buettner [EMAIL PROTECTED]; mysql@lists.mysql.com
Sent: Friday, October 06, 2006 6:31 PM
Subject: Re: multiple primary keys on one table?
You will have to UPDATE
I have a primary key set on a table which consists of the combination of the
values: firstname, lastname, and a schedule_id (BIGINT(20))... I have this
so the records in this table do not have duplicates, being that no one
record should have the exact same name and schedule_id identifier.
Ferindo, you can create multiple UNIQUE indexes on a table to enforce
your data requirements.
http://dev.mysql.com/doc/refman/5.0/en/alter-table.html
Dan
On 10/5/06, Ferindo Middleton [EMAIL PROTECTED] wrote:
I have a primary key set on a table which consists of the combination of the
values:
At 06:26 PM 10/5/2006, Ferindo Middleton wrote:
I have a primary key set on a table which consists of the combination of the
values: firstname, lastname, and a schedule_id (BIGINT(20))... I have this
so the records in this table do not have duplicates, being that no one
record should have the
Thanks. I now have this issue where I can't create the unique index on this
table because the email_address is often times blank or unknown for a while
(The front-end_application sets is value to '' (blank) on inserts and
updates if the user doesn't enter it so instead of going in as NULL, the