当前位置:网站首页>MySQL user-defined function ID number to age (supports 15 / 18 digit ID card)
MySQL user-defined function ID number to age (supports 15 / 18 digit ID card)
2022-07-05 14:10: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
边栏推荐
- mysql 自定义函数 身份证号转年龄(支持15/18位身份证)
- 魅族新任董事长沈子瑜:创始人黄章先生将作为魅族科技产品战略顾问
- 链表(简单)
- Xampp configuring multiple items
- TiFlash 面向编译器的自动向量化加速
- Zhizhen new energy rushes to the scientific innovation board: the annual revenue is 220million, and SAIC venture capital is the shareholder
- Leetcode array question brushing notes
- 金融壹账通香港上市:市值63亿港元 叶望春称守正笃实,久久为功
- Some ideas about Apache mesos
- 金融壹賬通香港上市:市值63億港元 葉望春稱守正篤實,久久為功
猜你喜欢

如何将 DevSecOps 引入企业?

TiCDC 6.0原理之Sorter演进

Mingfeng medical sprint technology innovation board: annual revenue of 350million yuan, proposed to raise 624million yuan

Anchor navigation demo

常见问题之PHP——Fatal error: Allowed memory size of 314572800 bytes exhausted...

OSI and tcp/ip protocol cluster

Laravel dompdf exports PDF, and the problem of Chinese garbled code is solved
![[cloud resources] what software is good for cloud resource security management? Why?](/img/c2/85d6b4a956afc99c2dc195a1ac3938.png)
[cloud resources] what software is good for cloud resource security management? Why?

Recommendation number | what are interesting people looking at?
![UE源码阅读[1]---由问题入手UE中的延迟渲染](/img/fa/f33242b01e4da973fa36c2c6f23db6.png)
UE源码阅读[1]---由问题入手UE中的延迟渲染
随机推荐
What is the future development trend of neural network Internet of things
:: ffff:192.168.31.101 what address is it?
PHP basic syntax
神经网络物联网未来现状和趋势及看法
Detailed explanation of IP address and preparation of DOS basic commands and batch processing
软件测试人在深圳有哪些值得去的互联网公司【软件测试人员专供版】
Leetcode array question brushing notes
R语言ggplot2可视化:可视化折线图、使用theme函数中的legend.position参数自定义图例的位置
TiFlash 面向编译器的自动向量化加速
Brief introduction to revolutionary neural networks
VC development of non MFC program memory leak tracking code
治臻新能源冲刺科创板:年营收2.2亿 上汽创投是股东
锚点导航小demo
怎么叫一手一机的功能方式
2022年机修钳工(高级)考试题模拟考试题库模拟考试平台操作
Jetpack compose introduction to mastery
[buuctf.reverse] 152-154
Make the seckill Carnival more leisurely: the database behind the promotion (Part 2)
Sorter evolution of ticdc 6.0 principle
汇编语言 assembly language