当前位置:网站首页>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
边栏推荐
- R语言使用MASS包的polr函数构建有序多分类logistic回归模型、使用coef函数获取模型中每个变量(自变量改变一个单位)对应的对数优势比(log odds ratio)
- upload (1-6)
- Interpretation of tiflash source code (IV) | design and implementation analysis of tiflash DDL module
- Anchor navigation demo
- uplad_ Labs first three levels
- R语言ggplot2可视化密度图:按照分组可视化密度图、自定义配置geom_density函数中的alpha参数设置图像透明度(防止多条密度曲线互相遮挡)
- 2022建筑焊工(建筑特殊工种)特种作业证考试题库及在线模拟考试
- mysql 自定义函数 身份证号转年龄(支持15/18位身份证)
- Implementation process of WSDL and soap calls under PHP5
- 判断变量是否为数组
猜你喜欢

Simple process of penetration test

Current situation, trend and view of neural network Internet of things in the future

Oneconnect listed in Hong Kong: with a market value of HK $6.3 billion, ye Wangchun said that he was honest and trustworthy, and long-term success

Scenario based technology architecture process based on tidb - Theory
![UE源码阅读[1]---由问题入手UE中的延迟渲染](/img/fa/f33242b01e4da973fa36c2c6f23db6.png)
UE源码阅读[1]---由问题入手UE中的延迟渲染

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

-Web direction attack and defense world

Zhizhen new energy rushes to the scientific innovation board: the annual revenue is 220million, and SAIC venture capital is the shareholder

Can graduate students not learn English? As long as the score of postgraduate entrance examination English or CET-6 is high!

In addition to the root directory, other routes of laravel + xampp are 404 solutions
随机推荐
C - Divisors of the Divisors of An Integer Gym - 102040C
Xampp configuring multiple items
2022年机修钳工(高级)考试题模拟考试题库模拟考试平台操作
MySQL if else use case use
国富氢能冲刺科创板:拟募资20亿 应收账款3.6亿超营收
Sqllab 1-6 exercise
Linked list (simple)
Postman简介、安装、入门使用方法详细攻略!
Ordering system based on wechat applet
Laravel - model (new model and use model)
金融壹账通香港上市:市值63亿港元 叶望春称守正笃实,久久为功
Detailed explanation of IP address and preparation of DOS basic commands and batch processing
VC开发非MFC程序内存泄漏跟踪代码
poi设置列的数据格式(有效)
怎么叫一手一机的功能方式
Routing in laravel framework
Assembly language - Beginner's introduction
Laravel dompdf exports PDF, and the problem of Chinese garbled code is solved
Deep copy is hard
R语言使用MASS包的polr函数构建有序多分类logistic回归模型、使用coef函数获取模型中每个变量(自变量改变一个单位)对应的对数优势比(log odds ratio)