用数据库语句查询年龄在19~21范围内的学生信息
答案:2 悬赏:0 手机版
解决时间 2021-03-22 19:29
- 提问者网友:浪荡绅士
- 2021-03-22 10:32
用数据库语句查询年龄在19~21范围内的学生信息
最佳答案
- 五星知识达人网友:狂恋
- 2021-03-22 11:38
select * from student
left join grade
on student.学号 = grade.学号
left join curriculum
on grade.课程编号=curriculum.课程编号
where DateDiff(yy, 出生日学号 期, getdate() ) between 19 and 21追问select * from student
left join grade
on student.学号 = grade.学号
left join curriculum
on grade.课程编号=curriculum.课程编号
where DateDiff(yy, 出生日期,getdate() ) between 19 and 21
left join grade
on student.学号 = grade.学号
left join curriculum
on grade.课程编号=curriculum.课程编号
where DateDiff(yy, 出生日学号 期, getdate() ) between 19 and 21追问select * from student
left join grade
on student.学号 = grade.学号
left join curriculum
on grade.课程编号=curriculum.课程编号
where DateDiff(yy, 出生日期,getdate() ) between 19 and 21
全部回答
- 1楼网友:佘樂
- 2021-03-22 11:56
select * from student where trunc((sysdate-出生日期)/365) between 19 and 21;
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯