IdentityNumber 是身份证号 年龄: ,), GETDATE()) / 365.25) as '推荐人年龄', 15位的身份证计算年龄: case when b.IdentityNumber IS null or b.IdentityNumber='' then '' ,), )) ,), )) else '' end as '推荐人年龄', 性别: ,) ) ) ) then '男' ,) ) ) ) then '女' else '' end as '推荐人性别',
select case left(idcard,2) when '11' then '北京市'when '12' then '天津市'when '13' then '河北省'when '14' then '山西省'when '15' then '内蒙古自治区'when '21' then '辽宁省'when '22' then '吉林省'when '23' then '黑龙江省'when '31' then '上海市'when '32' then '江苏省'when '33' then '浙江
elect case left(idcard,2) when '11' then '北京市' when '12' then '天津市' when '13' then '河北省' when '14' then '山西省' when '15' then '内蒙古自治区' when '21' then '辽宁省' when '22' then '吉林省' when '23' then '黑龙江省' when '31' then '上海市' when '32' then '江苏省' when '33
SELECT *, Age= datediff(yy,cast(case when substring(PersonalId,,) ') /*若第7位不是'1'或'2'则表示是15位身份证编码规则*/ then substring(PersonalId,,) ,) end as datetime),getdate()) FROM Student WHERE datediff(yy,cast(case when substring(PersonalId,,) ') then substring(P
项目要用到这个功能,就写了一个,完整类也就二百来行,很简单.可以在项目中用,也可以作为学习. 源码下载 http://yunpan.cn/cmQCSWkhDnZLJ 访问密码 0227 核心代码如下: using System; using System.Collections.Generic; using System.Collections; using System.Text; using System.Xml; using System.Text.RegularExpressions;
1.使用方法 #获取省份ID create temporary function getProvIdByCardIdUDF as 'com.st.PersonInfoByCardIdUDF.getProvIdByCardIdUDF' using jar 'hdfs:///HIVE_UDF/PersonInfoByCardIdUDF.jar'; #获取省份名称 create temporary function getProvNameByCardIdUDF as 'com.st.PersonInf