SELECT
doctors. fullname,
dutyroster.date,
dutyroster.time
FROM
dutyroster
INNER JOIN doctors ON doctors.docid = dutyroster.docid
WHERE doctors.docid = $doc_id AND
dutyroster.date = DATE(NOW()) AND DATE(NOW())+ INTERVAL 1 DAY
ORDER BY dutyroster.`date` ASC";
此查询用于从名为 dutyroster 的表中查找特定医生信息。我只想获取当天和明天的文档信息。但这不起作用。
我做了第二个,它也不起作用,因为它返回当前一个和所有下一个日期
SELECT
doctors. fullname,
dutyroster.date,
dutyroster.time
FROM
dutyroster
INNER JOIN doctors ON doctors.docid = dutyroster.docid
WHERE doctors.docid = $doc_id AND
DATE_SUB(CURDATE(),INTERVAL 2 DAY) <= dutyroster.date
ORDER BY dutyroster.`date` ASC"