📅  最后修改于: 2022-03-11 14:46:05.335000             🧑  作者: Mango
SELECT DATEDIFF (
year, DOB, getdate()) + CASE
WHEN (DATEADD(year,DATEDIFF(year, DOB, getdate()) , DOB) > getdate())
THEN - 1
ELSE 0
END
)