SELECT DATEPART(YEAR,BuyingTime) from T_Asset group by DATEPART(YEAR,BuyingTime)
sql server 根据日期中的年份分组
原文:https://www.cnblogs.com/yinmu/p/14866561.html