当前位置:网站首页>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
边栏推荐
- WebRTC的学习(二)
- Simple process of penetration test
- 04_solr7.3之solrJ7.3的使用
- [South China University of technology] information sharing of postgraduate entrance examination and re examination
- Interpretation of tiflash source code (IV) | design and implementation analysis of tiflash DDL module
- upload (1-6)
- 深拷贝真难
- [machine learning notes] several methods of splitting data into training sets and test sets
- Requset + BS4 crawling shell listings
- UE source code reading [1]--- starting with problems delayed rendering in UE
猜你喜欢

Shen Ziyu, nouveau Président de Meizu: M. Huang Zhang, fondateur de Meizu, agira comme conseiller stratégique pour les produits scientifiques et technologiques de Meizu
Jetpack compose introduction to mastery

Elfk deployment
![[js] basic syntax - for loop](/img/7f/6ddc47c062caa7d39538f88e12b1a0.jpg)
[js] basic syntax - for loop

金融壹账通香港上市:市值63亿港元 叶望春称守正笃实,久久为功

Deep copy is hard

laravel-dompdf导出pdf,中文乱码问题解决

Tdengine biweekly selection of community issues | phase III

Convolutional Neural Networks简述

PHP basic syntax
随机推荐
Jetpack compose introduction to mastery
为什么我认识的机械工程师都抱怨工资低?
让秒杀狂欢更从容:大促背后的数据库(下篇)
神经网络物联网未来发展趋势怎么样
展现强大。这样手机就不会难前进
Postman简介、安装、入门使用方法详细攻略!
POI set the data format of the column (valid)
Implementation process of WSDL and soap calls under PHP5
关于memset赋值的探讨
Detailed explanation of IP address and preparation of DOS basic commands and batch processing
如何将 DevSecOps 引入企业?
R语言ggplot2可视化密度图:按照分组可视化密度图、自定义配置geom_density函数中的alpha参数设置图像透明度(防止多条密度曲线互相遮挡)
Liar report query collection network PHP source code
鸿蒙第四次培训
基于 TiDB 场景式技术架构过程 - 理论篇
最简单不用证书也可以多开功能的方式
Make the seckill Carnival more leisurely: the database behind the promotion (Part 2)
鏈錶(簡單)
R语言ggplot2可视化:gganimate包基于transition_time函数创建动态散点图动画(gif)、使用shadow_mark函数为动画添加静态散点图作为动画背景
我为什么支持 BAT 拆掉「AI 研究院」