The usage of having and group by

group by usage
having usage

The field specified in the select must be included in the Group By statement as the basis for grouping; or it must be included in the aggregate function.

The field of conditional judgment after having must be the result returned by the aggregate function,

To persist in this life and not to persist, it’s too late to go to bed

Guess you like

Origin blog.csdn.net/taiguolaotu/article/details/112760061