SELECT a.activity_id,a.naam,a.no_pictures,count(picture_id) as aantal FROM activity a,picture p WHERE p.activity_id=a.activity_id AND p.merk_id= GROUP BY a.activity_id ORDER BY aantal DESC
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY a.activity_id ORDER BY aantal DESC' at line 1