使用 find_in_set() 函数也可,见貌似暂时没人用这个方法,分享给大家
SELECT
case
when FIND_IN_SET('male',profile) then 'male'
when FIND_IN_SET('female',profile) then 'female'
else '' end as 'gender',
count(*) number
from user_submit
group by gender
使用 find_in_set() 函数也可,见貌似暂时没人用这个方法,分享给大家
SELECT
case
when FIND_IN_SET('male',profile) then 'male'
when FIND_IN_SET('female',profile) then 'female'
else '' end as 'gender',
count(*) number
from user_submit
group by gender