记得有个timestampdiff(interval,time1,time2)函数,返回结果由interval决定,可以是year、mouth等
CONCAT(
CASE
WHEN FLOOR(TIMESTAMPDIFF(MONTH,c.platetime,CURRENT_DATE)/12)>0 THEN
CONCAT(FLOOR(TIMESTAMPDIFF(MONTH,c.platetime,CURRENT_DATE)/12),'年')
ELSE '' END,
CASE
WHEN TIMESTAMPDIFF(MONTH,c.platetime,CURRENT_DATE)%12>0 THEN
CONCAT(TIMESTAMPDIFF(MONTH,c.platetime,CURRENT_DATE)%12,'个月')
ELSE '0个月' END
))