If you want to use some kind of uniqueness for all future entries, keeping current duplicates, you cannot use the UNIQUE constraint.
You can use a trigger in a table to check the value that you want to insert against the current values โโof the table, and if it already exists, prevent insertion.
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_triggers.htm
or you can just remove duplicate values โโand then restrict the UNIQUE constraint.
EDIT: after the comments by Jonearles and Jeffrey Kemp, I will add that you can indeed include a unique constraint on a table with duplicate values โโrepresented using the NOVALIDATE , but you cannot have a unique index on this bounded column.
See Tom Keith's explanation here .
However, I will still worry about how obvious the intentions of future people are to maintain the database. From a support point of view, it would be more obvious to either remove duplicates or use a trigger to make your intention clear. Ymmv
Ollie source share