當某個字段中字符串是"1,2,3,4,5,6"或者"123456"
查詢數據表中某個字段是否包含某個值
1:模糊查詢
使用like
select * from 表 where 字段 like '%1%';
2:函數查找
find_in_set(str,數組)
select * from 表 where find_in_set('1','字段');
當某個字段中字符串是"1,2,3,4,5,6"或者"123456"
查詢數據表中某個字段是否包含某個值
1:模糊查詢
使用like
select * from 表 where 字段 like '%1%';
2:函數查找
find_in_set(str,數組)
select * from 表 where find_in_set('1','字段');