ITPub博客

首页 > 数据库 > 数据库开发技术 > 选择性唯一索引的使用

选择性唯一索引的使用

原创 数据库开发技术 作者:chenwj 时间:2007-01-24 16:06:41 0 删除 编辑

create unique index i on test(decode(flag,1,c1));
create unique index i on test(case(when flag=1 then c1||'&'||c2 ));
create unique index i on test(decode(flag,1,c1||'&'||c2));

针对标志列,对需要做唯一性限制的一列或多列进行唯一索引,可以参考的应用:
http://www.itpub.net/showthread.php?s=&threadid=707666&perpage=10&pagenumber=1

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7880643/viewspace-893049/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 成就DBA职业生涯
请登录后发表评论 登录
全部评论
  • 博文量
    3
  • 访问量
    3517