Difference between where and having in SQL Server

Published: 21 July 2021
on channel: DataGuru Naval
306
6

For database related videos, please subscribe channel
   / @datagurunaval  

WHERE clause cannot be used with aggregates, but the HAVING clause can.

Where clause filters rows before aggregate calculations are performed where as
Having clause filters rows after aggregate calculations are performed.
so from performance standpoint, HAVING is slower than WHERE and should be avoided when possible


On this page of the site you can watch the video online Difference between where and having in SQL Server with a duration of hours minute second in good quality, which was uploaded by the user DataGuru Naval 21 July 2021, share the link with friends and acquaintances, this video has already been watched 306 times on youtube and it was liked by 6 viewers. Enjoy your viewing!