List:General Discussion« Previous MessageNext Message »
From:Miles Thompson Date:October 6 2006 12:34am
Subject:Re: multiple primary keys on one table?
View as plain text  
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 exact same name and schedule_id identifier.
>
>However, I want to keep this same restriction while also ensuring that no
>two records have the same email_address and schedule_id identifier...
>
>You can't have the db enforce two different primary keys on one table, so
>how would I implement having this kind of restriction, which, in itself,
>seems to require that I have a second primary key to enforce another
>constraint to dissalow records to be added that carry the same combination
>of: email_address and schedule_id?
>
>just ferindo

unique index

M. 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.407 / Virus Database: 268.12.13/463 - Release Date: 10/4/2006


Thread
multiple primary keys on one table?Ferindo Middleton5 Oct
  • Re: multiple primary keys on one table?Dan Buettner5 Oct
    • Re: multiple primary keys on one table?Ferindo Middleton6 Oct
      • Re: multiple primary keys on one table?Gabriel PREDA6 Oct
  • Re: multiple primary keys on one table?Miles Thompson6 Oct
  • Re: multiple primary keys on one table?Martijn Tonies6 Oct
  • Re: multiple primary keys on one table?Renish6 Oct