1、用datediff函数
select datediff(yyyy,StuBirthday,getdate())>17
2、用year函数
select (year(getdate()-year(StuBirthday))