Khurram Satti
Khurram Satti

Reputation: 44

Like and group by in Laravel 4.2

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

Answers (1)

ARIF MAHMUD RANA
ARIF MAHMUD RANA

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

Related Questions