更新时间:2023-11-29 13:24:28
您可以使用基于函数的索引(FBI)来实现此目标:
You can achieve this using a funcction-based index (FBI):
create unique index idx on my_table (case when col != 'DEFAULT' then col end));
这会在除"DEFAULT"以外的所有值上创建唯一索引.
That creates a unique index on all values except 'DEFAULT'.