SELECT *
FROM claz
WHERE student AND (BETWEEN date AND date)
我有一张表claz
,我需要搜索以查找日期之间的学生记录
答案 0 :(得分:0)
您可以尝试使用它:
SELECT *
FROM claz
WHERE student = 'somevalue'
AND date_column BETWEEN '2013/02/25' AND '2013/02/27'
或者像这样:
SELECT *
FROM claz
WHERE student = 'somevalue'
AND date_column >'2013/02/25' AND date_column <'2013/02/27'
但是你想要实现的目标还不是很清楚
答案 1 :(得分:0)
尝试:
SELECT * FROM claz
WHERE student = ?
AND date BETWEEN date1 AND date2;
不确定您的学生应该匹配什么以及您的日期列具有什么名称。 无法测试,因为我现在不在我的数据库附近。
答案 2 :(得分:0)
试试这个..
SELECT * FROM claz WHERE student = 'BG' AND date < maxdate AND date > mindate;
答案 3 :(得分:0)
试试这个
SELECT *
FROM claz
WHERE student='name'
AND date BETWEEN 'date one' AND 'date two'