当前位置:网站首页>mysql 自定义函数 身份证号转年龄(支持15/18位身份证)
mysql 自定义函数 身份证号转年龄(支持15/18位身份证)
2022-07-05 14:00:00 【sr_www】
FUNCTION `idcard2age`(`idcard` varchar(255)) RETURNS int(10)
BEGIN
if(length(idcard)=18)then
return ifnull(timestampdiff(YEAR,substring(idcard,7,8),now()),-1);
elseif(length(idcard)=15)then
return ifnull(timestampdiff(YEAR,concat('19',substring(idcard,7,6)),now()),-1);
end if;
RETURN -1;
END
边栏推荐
- Why do I support bat to dismantle "AI research institute"
- When there are too many input boxes such as input transmitted at one time in the form, the post data is intercepted
- 神经网络物联网未来发展趋势怎么样
- Redis6 data type and operation summary
- 蓝桥杯学习2022.7.5(上午)
- Liar report query collection network PHP source code
- 几款分布式数据库的对比
- 判断变量是否为数组
- 治臻新能源冲刺科创板:年营收2.2亿 上汽创投是股东
- 锚点导航小demo
猜你喜欢

:: ffff:192.168.31.101 what address is it?

Why do I support bat to dismantle "AI research institute"

治臻新能源冲刺科创板:年营收2.2亿 上汽创投是股东

Attack and defense world web WP

Liar report query collection network PHP source code

upload (1-6)
![UE source code reading [1]--- starting with problems delayed rendering in UE](/img/fa/f33242b01e4da973fa36c2c6f23db6.png)
UE source code reading [1]--- starting with problems delayed rendering in UE

How to deal with the Yellow Icon during the installation of wampserver

Self built shooting range 2022

荐号 | 有趣的人都在看什么?
随机推荐
国富氢能冲刺科创板:拟募资20亿 应收账款3.6亿超营收
2022 driller (drilling) examination question bank and simulation examination
LeetCode_3(无重复字符的最长子串)
关于Apache Mesos的一些想法
Self built shooting range 2022
Elfk deployment
asp. Net read TXT file
Liste des liens (simple)
web3.eth. Filter related
神经网络物联网未来现状和趋势及看法
什么叫做信息安全?包含哪些内容?与网络安全有什么区别?
Linux下mysql数据库安装教程
Can graduate students not learn English? As long as the score of postgraduate entrance examination English or CET-6 is high!
鏈錶(簡單)
Redis6 transaction and locking mechanism
What category does the Internet of things application technology major belong to
LeetCode_67(二进制求和)
Pancake Bulldog robot V2 (code optimized)
Introduction to Chapter 8 proof problem of njupt "Xin'an numeral base"
TiCDC 6.0原理之Sorter演进