WHERE vs HAVING

后端 未结 7 2178
北荒
北荒 2020-11-22 08:20

Why do you need to place columns you create yourself (for example select 1 as \"number\") after HAVING and not WHERE in MySQL?

7条回答
  •  执笔经年
    2020-11-22 08:28

    Having is only used with aggregation but where with non aggregation statements If you have where word put it before aggregation (group by)

提交回复
热议问题