更新时间:2023-11-30 11:49:58
您的 GROUP BY bookslot.b_ref
正在对记录进行分组,因此您只能看到每种情况的最后一次。
Your GROUP BY bookslot.b_ref
is grouping the records, so you're only seeing the last time in each case.
尝试使用
SELECT date, time, MIN(bookslot.id_timeslot)
FROM bookslot
LEFT JOIN timeslot ON bookslot.id_timeslot = timeslot.id_timeslot
WHERE bookslot.status = 1
GROUP BY bookslot.b_ref
ORDER BY bookslot.date ASC, bookslot.id_timeslot ASC LIMIT 20