mysql开发笔记

函数find_in_set

//用法 find_in_set(str, strlist)
//举例
select * from table where find_in_set('1', ids);
//这样mysql就会把ids的值,按照逗号分隔的一个个元素去匹配。
//如果有多个使用or
select * from table where find_in_set('1', ids) or find_in_set('2', ids); 

你可能感兴趣的:(mysql,笔记)