Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Unique Index on duplicate value column

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Unique Index on duplicate value column
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    Post subject:
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    Post subject: Reply to: Unique Index on duplicate value column
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us