Chapter 3 – Aggregation

“DB2 climbed Aggregate Mountain and delivered a better way to Sum It.”

- Tera-Tom Coffing

Quiz – You calculate the Answer Set in your own Mind

image

SELECT      Avg(Grade_Pt)      AS "AVG"

,Count(Grade_Pt)   AS "Count"

,Count(*)                AS "Count *"

FROM        Student_Table

WHERE     Class_Code IS NULL

AVG    Count    Count * 

What would the result set be from the above query? The next slide shows answers!

Answer – You calculate the Answer Set in your own Mind

image

SELECT      Avg(Grade_Pt)      AS "AVG"

,Count(Grade_Pt)  AS ...

Get Tera-Tom Genius Series - DB2 SQL now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.