what's the difference between WHERE and HAVING

前端 未结 5 834
孤街浪徒
孤街浪徒 2021-02-07 02:31

It looks like both WHERE and HAVING help filter rows. I wonder if, instead of having to HAVING, I can use WHERE ... AND.

5条回答
  •  -上瘾入骨i
    2021-02-07 03:10

    Where clause is used to filter out rows from all over the database. But Having clause is used to filter out rows from a specific group of database. Having clause can also help in aggregate function like min/max/average.

    Follow the link for more detail https://www.codeproject.com/Articles/25258/Where-Vs-Having-Difference-between-having-and-Wher

提交回复
热议问题