Query works in MySQL, but not in Laravel

0

I run a query on MySQL that works and on Laravel does not, follow

SQL :

select resource_id as "pedido", count(resource_id) as "perguntas",
       date_received from perguntas_pos where status="UNANSWERED" 
group by 1 order by 2 desc

  

Laravel

Why do I have to put SQLSTATE[42000]: Syntax error or access violation: 1055 'pergunta_ml.perguntas_pos.date_received' isn't in GROUP BY (SQL: select resource_id as "pedido", count(resource_id) as "perguntas", date_received from perguntas_pos where status="UNANSWERED" group by 1 order by 2 desc) on date_received too?

    
asked by anonymous 18.02.2018 / 21:41

0 answers