Chapter using simple functions select product
Chapter 4: Using Simple Functions 127
SELECT product_type_id, AVG(price)
FROM products
WHERE price < 15
GROUP BY product_type_id
HAVING AVG(price) > 13
ORDER BY product_type_id;
PRODUCT_TYPE_ID AVG(PRICE)
--------------- ----------
3 13.24
13.49
2 14.45Summary
In this chapter, you have learned the following:■ Groups of rows may be filtered using the HAVING clause.
In the next chapter, you’ll learn about dates and times.