根据身份证号出生年月计算年龄(周岁) select TIMESTAMPDIFF(YEAR, SUBSTRING('xxxxxx19900828xxxx', 7, 8), CURDATE()) AS age