select xx as fieldA from ... group by xxx having fieldA is not null
开发者_Go百科
I found that having
has no effect
May be :
select xx as fieldA from ... where fieldA is not null group by xxx having
help you
You should include all non-aggregate columns in the GROUP BY
. 5.7.5 introduced the SQL_MODE
of only_full_group_by
to enforce such (while not complaining about some cases where it is actually OK).
When you have a non-aggregate column, the code is free to provide any value it likes for such a column (xx
in your case). Given that, then how could the HAVING
make any rational sense.
This is not a bug; it is a user error.
精彩评论