Previous Topic

Next Topic

Book Contents

Book Index

Having Clause

When you are doing a summary query, you can also specify a Having clause. This is like a Where clause, except that it involves a summary value, rather than a column value.

In our example of customer revenue, the following query shows you customer revenue when it is more than $1000:

Select customer_code, month, sum(revenue) from orders group by customer_code, month having sum(revenue) > 1000

In a summary query, the Where tab and Where Clause windows include options for dealing with Having Clauses

Having versus Where

The easiest way to understand the difference between a Where clause and a Having clause is as follows.