且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Oracle约束

更新时间: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'.