How to calculate a non-inflated count from a denormalized table
问题 Suppose I have a denormalized table that includes an ID and a value that I need to count. Something like this: Tree_ID | ...other columns... | Count_If_True ------------------------------------------------ 1 | ...other values... | True 1 | ...other values... | True 2 | ...other values... | True 2 | ...other values... | True 3 | ...other values... | True In this case, select Tree_ID, count(Count_If_True) from Table group by Tree_ID would show: Tree_ID | count(Count_If_True) -------------------