栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

hive跟nvl较相似的函数,参数可以更多

hive跟nvl较相似的函数,参数可以更多

非空查找函数: COALESCE
语法: COALESCE(T v1, T v2,…)
说明: 返回参数中的第一个非空值;如果所有值都为NULL,那么返回NULL
举例:

select
COALESCE(t1.area_code,t2.area_code,t3.area_code,t4.area_code,t5.area_code)
,COALESCE(t1.area_name,t2.area_name,t3.area_name,t4.area_name,t5.area_name)
,COALESCE(t1.day_time,t2.day_time,t3.day_time,t4.day_time,t5.day_time)
from
ads_smart_community.ads_person_sum t1
full outer join
ads_smart_community.ads_vehicle_sum t2
on t1.area_code = t2.area_code and t1.day_time = t2.day_time
full outer join
ads_smart_community.ads_judge_sum t3
on t1.area_code = t3.area_code and t1.day_time = t3.day_time
full outer join
ads_smart_community.ads_device_sum t4
on t1.area_code = t4.area_code and t1.day_time = t4.day_time
full outer join
ads_smart_community.ads_technical_defense_alarm t5
on t1.area_code = t5.area_code and t1.day_time = t5.day_time
;

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/423137.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号