Similar to the
Add constraint alter table XXX XXX unique (field 1, 2, and field 3) where is_del=0
This logic could you tell me how to write SQL should be urgent ~ ~ ~!!!!!! Thank you ~ ~!!!!!!
CodePudding user response:
I have added a unique indexCreate unique index uq_name_idx on XXX (nvl2 (nullif (is_del, 1), field 1, null, nvl2 (nullif (is_del, 1), field 2, null, nvl2 (nullif (is_del, 1), field 3, null));
CodePudding user response:
CodePudding user response:
The original poster is mysql or oracle?