题解 | #查看不同年龄段的用户明细#
查看不同年龄段的用户明细
http://www.nowcoder.com/practice/ae44b2b78525417b8b2fc2075b557592
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;
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;