建立两个表,操作员和角色表
CREATE TABLE `oper` (
  `id` tinyint(4) NOT NULL auto_increment,
  `role` set('business','oper','admin') NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=gbkCREATE TABLE `role` (
  `id` tinyint(4) NOT NULL auto_increment,
  `name` varchar(16) NOT NULL,
  `function` varchar(32) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=gbkrole 表中:id name function
------------------------------------------------
1 admin stop
2 admin start
3 oper view
5 business add
6 business updateoper 表中:
id role
-------------------------------------------------
1 oper
2 business,admin
现在想找出oper.id=2 的role所对应的function
select role.function from oper, role
where  role.name  in  (select oper.role from oper where id=2);由于oper.role字段是set类型,select 出来的是“business,admin", 我用 in (select ...) 匹配不出来,
不知道怎么写才行 ?多谢