Conditional counting: Performance differences in using SUM() vs COUNT()?

前端 未结 4 1813
隐瞒了意图╮
隐瞒了意图╮ 2021-01-18 10:38

Just as a very simple example, let\'s say I have table test with sample data like so:

a     |     b      
-------------
1     |    18
1     |            


        
4条回答
  •  一生所求
    2021-01-18 10:58

    With COUNT, you count the elements, using SUM you add numbers (positive, negative or zero) for a result that can be negative.

提交回复
热议问题