日期:2014-05-16 浏览次数:20911 次
CREATE TABLE `20121101_t` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL,
`cl` set('x','w','r') NOT NULL,
`c2` enum('f','d') NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB
insert into 20121101_t
values(null,'a.txt','r,w','d');
insert into 20121101_t
values(null,'b.txt','r,w','f');update 20121101_t set cl = cl|1 where id =2
update 20121101_t set cl = cl&~2 where id =2
select * from 20121101_t
update 20121101_t set cl = 4 where id =2
select * from 20121101_t where cl&4
select * from 20121101_t where FIND_IN_SET('r',cl)>0update 20121101_t set c2 = 'f' where id =1