Like that:
COUNT(i.t_1) AS total_images
WHERE total_images > 2
Throws an error:
Unknown column "total_images" in where clause
If this way:
WHERE COUNT(i.t_1) > 2
Throws an error:
Invalid use of group function
How to do it right way?
If need i'll post full statement.
The meaning of this query to pick the 1 ad with the most photos inside joined(images) table.
Thanks ;)