Hive计算身份证年龄

year(from_unixtime(unix_timestamp(),"yyyy-MM-dd")) - year(to_date(from_unixtime(unix_timestamp(substr(usr_id_card,7,8),'yyyyMMdd'),'yyyy-MM-dd')))

 

你可能感兴趣的:(大数据,hive)