我有一张桌子,上面有学生,日子和时间。有些每周一次,有些甚至几周,有些奇数周。我的桌子看起来像:
我需要构建一个查询,以检查当前一周中期望的人。我有确定周数的代码,所以我看看是奇数还是偶数周。但是在同一天两次学习的学生只会显示一次?
我的查询如下:
SELECT *
FROM Student
WHERE
day1='$weekdag'
AND(week1='all' OR week1='even')
OR day2='$weekdag' AND (week2='all' OR week2='odd')
ORDER BY time1, time2
LIMIT 10