0

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?

Arnaud
  • 7,259
  • 10
  • 50
  • 71

1 Answers1

1

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

Community
  • 1
  • 1
ARIF MAHMUD RANA
  • 5,026
  • 3
  • 31
  • 58