|
|
| Author |
Message |
simimathew
New User
Joined: 26 Jan 2006 Posts: 17 Location: London
|
|
|
|
Hi,
1) Can a unique index be created on a column that already has duplicate values? I tried doing it on DB2 UDB and it is not letting me create a unique index.
2) But I remember having read somewhere that two nulls are considered to be equal for UNIQUE indexing purposes. How do you create a UNIQUE INDEX on an already existing nullable column?
3) Also could you please point out the difference between primary key and unique index?
Many Thanks,
Simi |
|
| Back to top |
|
 |
References
|
Posted: Tue Jul 08, 2008 9:26 pm Post subject: Re: Unique Index on duplicate value column |
 |
|
|
 |
ashimer
Senior Member
Joined: 13 Feb 2004 Posts: 311 Location: Bangalore
|
|
|
|
| Quote: |
somewhere that two nulls are considered to be equal
|
Only a single null value is allowed in an UNIQUE indexing column ...
Primary key will not allow any NULL ...
Unique itself means no duplicates are allowed ... |
|
| Back to top |
|
 |
simimathew
New User
Joined: 26 Jan 2006 Posts: 17 Location: London
|
|
|
|
| Thanks very much. |
|
| Back to top |
|
 |
|
|