select device_id,gender,
IF (age < 20,"20岁以下",
   IF(age <= 24,"20-24岁",
     IF(age >= 25,"25岁及以上","其他")
     )
   ) as age_cut
from user_profile