Executed Query -> select tcmt.*, t.treatment_name, cate.categoryname, subcate.subcategoryname, ti.image_name, count(r.id) as total_no_of_reviews from tbl_tcm_treatments tcmt left join tbl_treatment_images ti on ti.tcmt_id = tcmt.id left join tbl_treatments t on t.id = tcmt.treatment_id left join tbl_category cate on cate.categoryid = t.category_id left join tbl_subcategory subcate on subcate.subcategoryid = t.subcategory_id left join tbl_reviews r on r.tcmt_id = tcmt.id where added_by_admin = 'y'
ERROR:"SQLSTATE[42000]: Syntax error or access violation: 1140 In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'treatment_scout.tcmt.id'; this is incompatible with sql_mode=only_full_group_by: 308"