select reports.report_date, group_concat(reports.report_order_id) as order_id from reports left join sources on reports.report_source_id = sources.id where reports.report_date between ? and ? group by reports.report_date order by sources.id asc
Oke you group by the parent table and that's why the order of sources doesn't matter anymore, you don't return the soruces you only join them. Since you group it by the parent (reports) the children (sources) will never be added to the select so you won't see them
Thanks bobbybouwmann for your valuable comment. But how can I do that ?? I need to do that. Is it possible do it like
->orderBy('reports.report_source_id','ASC'). ?? Thanks
Thanks bobbybouwmann. Your solution gives me different result. I am trying with ->orderBy('reports.report_source_id','ASC') . Why this one is not working ?? I worked with this sort of problems previously. As far as I know these solution should work. But today it is not working. I could not find out the problem. Thanks