方法:
select
name,
birth as birthday,
if(datediff(CURRENT_DATE, CONCAT(substr(CURRENT_DATE, 0, 4), substr(birth, 5, 7))) >= 0, substr(CURRENT_DATE, 0, 4) - substr(birth, 0, 4), substr(CURRENT_DATE, 0, 4) - substr(birth, 0, 4) - 1)
as age
from ods_busdb.order_passenger_0
where create_at >= '2020-08-26'
and create_at < '2020-08-27'
and d = '2020-08-26'