日期:2014-05-18 浏览次数:20793 次
select * from t_tdscore where FIND_IN_SET(s_StudentProvinceID,s_SchoolProvinceID)>0;
------解决方案--------------------
CREATE TABLE IF NOT EXISTS `test` (
`id` int(8) NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`list` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
);
INSERT INTO `test` VALUES (1, 'name', 'daodao,xiaohu,xiaoqin');
INSERT INTO `test` VALUES (2, 'name2', 'xiaohu,daodao,xiaoqin');
INSERT INTO `test` VALUES (3, 'name3', 'xiaoqin,daodao,xiaohu');
select * from `test` where FIND_IN_SET('daodao',`list`);
/*1 name daodao,xiaohu,xiaoqin
2 name2 xiaohu,daodao,xiaoqin
3 name3 xiaoqin,daodao,xiaohu
*/