Reputation: 44
I use group by
with a count function in LARAVEL 4.2. When I tried to use LIKE
in the same query, it gave me the error Invalid use of group function
, as we can't use like
with group by
. How can I solve this?
Upvotes: 0
Views: 165
Reputation: 5166
You can't use Mysql aggregate function with group
& like
both together you have to use having
instead of like
.
Check here MySQL :: MySQL 5.0 Reference Manual :: 12.16.3 MySQL Handling of GROUP BY
and here: A similar SO question answer
Upvotes: 1