IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Unique Index on duplicate value column


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
simimathew

New User


Joined: 26 Jan 2006
Posts: 23
Location: London

PostPosted: Tue Jul 08, 2008 9:26 pm
Reply with quote

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
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Wed Jul 09, 2008 3:02 pm
Reply with quote

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
View user's profile Send private message
simimathew

New User


Joined: 26 Jan 2006
Posts: 23
Location: London

PostPosted: Wed Jul 09, 2008 3:18 pm
Reply with quote

Thanks very much.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts first column truncated in search result IBM Tools 13
Search our Forums:

Back to Top