是高手的进来
我有一个student表中含有列birthday
birthday
1983-10-20
1985-6-6
1984-5-4
1987-5-1
...
我想增加一列age,来计算年龄,结果:
birthday age
1983-1-2 24
1985-1-1 22
1984-1-1 23
1987-1-1 20
[解决办法]
update 表名 set age=datediff(yy,birthday,getdate())