CASE WHEN
1.不能直接判断区间,需要加and
错误示范:会报错SQL 错误 [40000] [42000]: Error while compiling statement: FAILED: ParseException line 8:20 cannot recognize input near '>=' '-' '9' in expression specification
select
t.user_id,
t.buy_mount,
t.day,
t.birthday,
case
when -9>t.rage then '备孕'
when -7>t.rage>=-9 then '孕早期'
when -3>t.rage>=-7 then '孕中期'
when 0>t.rage>=-3 then '孕晚期'
when