select case when right(profile,5) = ',male' then 'male' when right(profile,7) = ',female'then 'female' end gender, count(device_id) as number from user_submit group by gender;