hive中的case when,有多个条件时,可以这样写:
select substr(key,13,2), case when birthday<'1968' then '50up' when birthday<'1978' then '40-50' when birthday<'1983' then '35-40' when birthday<'1988' then '30-35' when birthday<'1992' then '26-30' when birthday<'1998' then '20-25' else 'other' end, count(1) from hiveTable group by substr(key,13,2), case when birthday<'1968' then '50up' when birthday<'1978' then '40-50' when birthday<'1983' then '35-40' when birthday<'1988' then '30-35' when birthday<'1992' then '26-30' when birthday<'1998' then '20-25' else 'other' end