SELECT `c`.`F_ID`, `c`.`F_Name` `Com_Name` FROM `tb_result_match` `t` LEFT JOIN `tb_competition` `c` ON `t`.`comp`=`c`.`F_ID` WHERE `play` > '2019-11-12 09:00' AND `play` < '2019-11-13 09:00' GROUP BY `c`.`F_ID` ORDER BY `c`.`que`