摘要:
按照出生日期来计算学生的年龄信息 IF OBJECT_ID('GetStudentAge','FN') IS NOT NULL DROP FUNCTION GetStudentAge GO CREATE FUNCTION GetStudentAge(@birth DATE) RETURNS INT 阅读全文
摘要:
查询各学生的年龄,只按年份来算 SELECT *,year(GETDATE())-YEAR(Sage)年龄 from Student 阅读全文
摘要:
查询选修了全部课程的学生信息 SELECT * from Student WHERE SId IN ( SELECT sid from sc GROUP BY sid HAVING COUNT(cid) = (SELECT COUNT(*) FROM Course)) 阅读全文