粗略计算 select (DATE_FORMAT(NOW(), '%Y')-substring(cid,7,4))age from test WHERE id =1
精确计算 select FLOOR(DATEDIFF(DATE_FORMAT(now(),'%Y%m%d'),substring(pp.cid,7,8))/365.25) age from test pp WHERE pp.id = 1;
粗略计算 select (DATE_FORMAT(NOW(), '%Y')-substring(cid,7,4))age from test WHERE id =1
精确计算 select FLOOR(DATEDIFF(DATE_FORMAT(now(),'%Y%m%d'),substring(pp.cid,7,8))/365.25) age from test pp WHERE pp.id = 1;