List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:October 15 1999 1:32pm
Subject:Re: Unique
View as plain text  
Anders Jöfelt wrote:
> 
> Hi!
> 
> First I want to make clear that I´m using 3.22.27 of MySQL and I don´t
> know
> how to make this:
> 
> I´d like to set one column Unique but I want it to accept null values like
> this:
> 
> CREATE TABLE Data(
>        FirstName VARCHAR(30),
>        GivenName VARCHAR(30),
>        PersonalNbr CHAR(11),
>        Identifier INT PRIMARY KEY);
> 
> My Key is Identifier as you see and I want PersonalNbr to be Unique... I´ve
> tried with:
> 
> PersonalNbr CHAR(11) UNIQUE
> 
> UNIQUE (PersonalNbr)
> 
> Creating indexes but the server wants me to insert a not null and that takes
> the whole point out! I think this is supported in 3.23 but it´s a Alpha and
> we´ve just got 3.22.27.
> 
> Please give me an alternative to get that stupid column Unique but null.....
> 
> > ____________________________________________
> > Anders Jöfelt                           +46 40 24 99 89 (Phone)
> > Master Thesis Student             +46 40 24 99 50 (Fax)
> > Sigma Exallon Systems AB
> >
> >
> 
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail mysql-thread16041@stripped
> 
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail mysql-unsubscribe@stripped instead.


Normalize !
Put your PersonalNbr in a separate table, and use a left join.
Thread
UniqueAnders J√∂felt14 Oct
  • Re: UniqueBenjamin Pflugmann15 Oct
    • Re: UniqueBob Kline15 Oct
      • Re: UniqueMichael Widenius17 Oct
  • Re: UniquePaul DuBois15 Oct
  • Re: UniqueGerald Clark15 Oct