select device_id,gender,'20-24岁' from user_profile where age>=20&&age<=24
union 
select device_id,gender,'25岁及以上' from user_profile where age>=25
union 
select device_id,gender,'其他' from user_profile where age is null
order by device_id;