View previous topic :: View next topic
|
Author |
Message |
simimathew
New User
Joined: 26 Jan 2006 Posts: 23 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 |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 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: 23 Location: London
|
|
|
|
Thanks very much. |
|
Back to top |
|
|
|