Suppose I have a denormalized table that includes an ID and a value that I need to count. Something like this: In this case, select Tree_ID, count(Count_If_True) from Table group by Tree_ID would show: But If I denormalize my table further with a join from an Apples table (where every tree has multiple apples), it would look something like this: