提前致谢:请帮我写一个 sql 查询来查找员工的退休日期出生。
TeacherName DateOfBirth TeacherAge SupperannuationDate(onwhich teacher going to be 60 yers)
-------------------------------------------------------
S. KHALID SALIM 1958-03-23 00:00:00.000 55
ZUBAIDA BEGUM 1976-08-01 00:00:00.000 36
TANZEEM AKHTAR 1974-09-25 00:00:00.000 38
MARYAM BIBI 1982-08-18 00:00:00.000 30
RABIA TABASSUM 1976-11-10 00:00:00.000 36
这是我的查询,我需要一个名为“AnnunationDate”的第四列,其中教师年龄为 60 岁。
select TeacherName ,DateOfBirth , datediff(mm, DateOfBirth, getdate()) / 12 as TeacherAge from Teachers
------------------------例如在第一行它将显示在第四列 1963-03-23 00:00:00.000 somthing