mysql如何计算两个时间之间的年数

2025-01-31 16:51:32
推荐回答(1个)
回答1:

SET @a = '2015-09-15 12:00:00';SET @b = '2011-09-15 12:00:00';SELECT YEAR(@a) - YEAR(@b);