case……when……
select substring(身份证号,7,8) as 出生日期, YEAR (now()) - YEAR (substring(身份证号, 7, 8)) 年龄, CASE when Substring(身份证号,17,1)%2 = 1 then '男' else '女' END AS 性别 from 转换 case……when……子句主要用于多种情况的分类去重手法
mysql:create table temp select distinct * from 需要转换的表
sql server:select distinct * into temp from 需要转化的表
分列操作
参考:https://deepinout.com/mysql/mysql-questions/t_how-to-split-a-column-in-mysql.html
标签:SQL,补充,身份证号,YEAR,知识,when,substring,mysql,select From: https://www.cnblogs.com/live-zeye/p/18059543