Hive中case when的两种语法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/kwame211/article/details/86606674

总结一下:两种表达方式是等效的 
方法一:

case 
when tb1.os = 'android' then 'android'
when tb1.os = 'ios' then 'iPhone'
else 'PC'
end as os,
 
方法二:

case tb1.os
when 'android' then 'android'
when 'ios' then 'iPhone'
else 'PC'
end as os,
 

猜你喜欢

转载自blog.csdn.net/kwame211/article/details/86606674