我已经编写了这个MySQL查询来过滤数据,我认为在查询工作中,如果它得到相等的值,但不能在值之间工作。请帮我解决这个问题..
SELECT *
FROM
table_name
WHERE
job_date='" . $jobDateAfterFormat . "'
AND employee_id='" . $employee_id . "'
AND (
start_time = '" . $start_time . "'
OR start_time BETWEEN '" . $start_time . "' AND '" . $finish_time . "'
OR finish_time='" . $finish_time . "'
OR finish_time BETWEEN '" . $start_time . "' AND '" . $finish_time . "')
job_date用作时间戳,start_time和finish_time使用18:30,07:30格式。