i want to select only one image for each post id
i useally use this query : select dir,post from images group by post
but since i upgraded to mysql 5.7 this wont work because of only_full_group_by is enabled
i tried evry thing to disable but i failed
is there is equivalent query that do the same job ??
The solution is to use an aggegration function on the column(s) that are not in the group by clause. In your case that would be the ‘dir’ column. If you don’t care which image is returned, you could use the MIN() or MAX() function.