朋友谈及身份证相关的信息,才了解到原来省份证号码中包含了年龄和性别. 这样在数据库中,就不必单独留字段存放它们了(不过,要根据具体情况来,要是读取频率较高,还是单独列出为好),这样顺带解决了年龄变更的问题. 程序仅仅为了实现这个功能,里面还是需要数据验证的,用户输入的信息,毕竟在猿类看来,都是“非法的”.废话不多说了,贴上我写的程序,还请路过的大神斧正: using System; using System.Collections.Generic; using System.Linq; usin
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 t.card_number ,) AS "省份", SUBSTR(t.card_number,,) "出生年月", SUBSTR(t.card_number,,) "性别" , CASE (SUBSTR(t.card_number,,)%) WHEN THEN '男' WHEN THEN '女' END AS '性别' FROM user t ;
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
1.重命名,Python中文路径各种错误,所以需要先将所有文件的路径名全都改成中文.用的是MAC系统,所以WIN下的命令行批处理没法解决,所以用C来完成 // Created by Carl on 16. // Copyright (c) 2016年 Carl. All rights reserved. // #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h&
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