Showing posts with label having clause. Show all posts
Showing posts with label having clause. Show all posts

Wednesday, 7 December 2016

Difference Between Where and Having Clause

The WHERE clause does not work with aggregates like SUM,Count etc. The SQL above will not work, because the where clause doesn’t work with aggregates – like sum, avg, max, etc.. Instead, what we will need to use is the having clause. The having clause was added to sql just so we could compare aggregates to other values – just how the ‘where’ clause can be used with non-aggregates....