我有以下查询:
select
count(*) as aggregate
from
`images`
where
`images`.`imageable_id` = ?
and `images`.`imageable_id` is not null
and `images`.`imageable_type` = ?
and `generated` = ?
order by
`order` asc
当我在MySQL REPL中运行它时,它运行得很好。但是,当我使用PDO在PHP中运行它时,我收到以下错误:
SQLSTATE[42000]: Syntax error or access violation: 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
我正在运行PHP版7.0.23-1+ubuntu14.04.1+deb.sury.org+1
有没有人提示如何诊断和解决这个问题?