August 2002
Intermediate to advanced
528 pages
10h 12m
English
The last SELECT statement clause to be discussed is the HAVING clause. This clause is similar to the WHERE clause in that it determines whether the record is eligible for selection. The clause contains arguments used to evaluate records. Multiple conditions can be placed in the HAVING clause. The AND and OR keywords can also be used within the clause to develop complex logic.
The difference between the HAVING clause and the WHERE clause is that one of the arguments in a HAVING clause condition must be a group function. The HAVING clause is used only when a grouped value is computed by the SELECT statement. This requires a group function to exist in the SELECT clause. Listing 5.15 illustrates ...