Is it possible to have a unique constraint such that one particular column has a value only once?
For instance
-----------------------
name | pri
I have solved this problem with a strange aproch, using TIMESTAMP
as a flag.
That`s usead as a "deleted" FLAG.
If IS NULL, then the register it's not deleted - Instead, if is deleted (<> NULL), the unique key will never conflict avoiding duplicate registers for non flaged as deleted registers.
For example in your case:
You will never have 2 rows with default: NULL, but you can have N with TIMESTAMP with they exclude time.