当前位置:网站首页>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
边栏推荐
- [machine learning notes] how to solve over fitting and under fitting
- 什么叫做信息安全?包含哪些内容?与网络安全有什么区别?
- Liar report query collection network PHP source code
- Simple PHP paging implementation
- Comparison of several distributed databases
- Blue Bridge Cup study 2022.7.5 (morning)
- 明峰医疗冲刺科创板:年营收3.5亿元 拟募资6.24亿
- 2022建筑焊工(建筑特殊工种)特种作业证考试题库及在线模拟考试
- Laravel - model (new model and use model)
- 瑞能实业IPO被终止:年营收4.47亿 曾拟募资3.76亿
猜你喜欢

Simple process of penetration test

国富氢能冲刺科创板:拟募资20亿 应收账款3.6亿超营收

Self built shooting range 2022
![Primary code audit [no dolls (modification)] assessment](/img/b8/82c32e95d1b72f75823ca91c97138e.jpg)
Primary code audit [no dolls (modification)] assessment

IP packet header analysis and static routing

Introduction to Chapter 8 proof problem of njupt "Xin'an numeral base"

Recommendation number | what are interesting people looking at?

Scientific running robot pancakeswap clip robot latest detailed tutorial

About the problem and solution of 403 error in wampserver

【华南理工大学】考研初试复试资料分享
随机推荐
Solution to the prompt of could not close zip file during phpword use
[js] basic syntax - for loop
Wechat app payment callback processing method PHP logging method, notes. 2020/5/26
In addition to the root directory, other routes of laravel + xampp are 404 solutions
js 从一个数组对象中取key 和value组成一个新的对象
神经网络物联网未来发展趋势怎么样
JS takes key and value from an array object to form a new object
蓝桥杯学习2022.7.5(上午)
Set up a website with a sense of ceremony, and post it to the public 2/2 through the intranet
根据CronSequenceGenerator计算cron表达式的时间
Embedded software architecture design - message interaction
基于微信小程序的订餐系统
Source code analysis of etcd database -- peer RT of inter cluster network layer client
Xampp configuring multiple items
::ffff:192.168.31.101 是一个什么地址?
深拷贝真难
Detailed explanation of IP address and preparation of DOS basic commands and batch processing
Aspx simple user login
PostgreSQL Usage Summary (PIT)
ETCD数据库源码分析——集群间网络层客户端peerRt