gmc1103 Posted September 19, 2015 Share Posted September 19, 2015 Hello I'm having a problem regarding a query because i don't have all the records and i don't know why This is the query SELECT `ebspma_paad_ebspma`.`semana_dias`.`dia`,`ebspma_paad_ebspma`.`req_material_sala`.`sala`, `ebspma_paad_ebspma`.`req_material_tempo`.`inicio`, `ebspma_paad_ebspma`.`sala_ocupacao`.`id_ocup`, `ebspma_paad_ebspma`.`turmas`.`turma` FROM `ebspma_paad_ebspma`.`sala_ocupacao` INNER JOIN `ebspma_paad_ebspma`.`semana_dias` ON (`sala_ocupacao`.`id_dia` = `semana_dias`.`id_dia`) INNER JOIN `ebspma_paad_ebspma`.`req_material_sala` ON (`sala_ocupacao`.`id_sala` = `req_material_sala`.`idsala`) LEFT JOIN `ebspma_paad_ebspma`.`req_material_tempo` ON (`sala_ocupacao`.`id_tempo` = `req_material_tempo`.`idtempo`) LEFT JOIN `ebspma_paad_ebspma`.`turmas` ON (`sala_ocupacao`.`id_turma` = `turmas`.`id_turma`) where`ebspma_paad_ebspma`.`sala_ocupacao`.`id_turma` = '$turma' GROUP BY `ebspma_paad_ebspma`.`sala_ocupacao`.`id_dia` , `ebspma_paad_ebspma`.`req_material_tempo`.`inicio` ASC And i have this result (school_result.jpg) and it should be (school_result_correct.jpg) because in my school timetable i have two classroom for that class (school.jpg) Any help why i can't have those values? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/298227-query-help/ Share on other sites More sharing options...
Barand Posted September 19, 2015 Share Posted September 19, 2015 Don't know, I can't see the data from here. Quote Link to comment https://forums.phpfreaks.com/topic/298227-query-help/#findComment-1521172 Share on other sites More sharing options...
gmc1103 Posted September 19, 2015 Author Share Posted September 19, 2015 Hi Barand Thanks for your information, i fixed the issue using group by day, class, time, then order by day and time. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/298227-query-help/#findComment-1521174 Share on other sites More sharing options...
Barand Posted September 19, 2015 Share Posted September 19, 2015 Sorry I couldn't be more helpful but I wasn't going to attempt to juggle data from five tables of unknown structure and content in my head. Quote Link to comment https://forums.phpfreaks.com/topic/298227-query-help/#findComment-1521176 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.