create table th_test1
(
a char(1),
b char(1),
c char(1)
)
CREATE UNIQUE INDEX uq_test1 on th_test1(decode(c,'Y',a,null),decode(c,'Y',b,null),decode(c,'Y',c,null));跪求大神帮忙看看在mysql中怎么实现这中联合唯一函数索引.......
(
a char(1),
b char(1),
c char(1)
)
CREATE UNIQUE INDEX uq_test1 on th_test1(decode(c,'Y',a,null),decode(c,'Y',b,null),decode(c,'Y',c,null));跪求大神帮忙看看在mysql中怎么实现这中联合唯一函数索引.......
UPDATE th_test1 SET C='N' WHERE A='B';
insert into th_test1 values('B','W','Y');
UPDATE th_test1 SET C='N' WHERE A='B';