Eroare a bazei de date

Error Number: 1055

Expression #8 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'monamour_masaj2019.p.photo' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

SELECT kc_photo_categories.*, COUNT(p.id) as num_photos, p.photo FROM kc_photo_categories LEFT JOIN kc_photos p ON p.parent_id = kc_photo_categories.id WHERE kc_photo_categories.visible = 1 AND p.visible = 1 GROUP BY (p.parent_id)