您
GROUP BY bookslot.b_ref正在对记录进行分组,因此每种情况下您只会看到最后一次。
尝试使用
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
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)