Opethian Opethian - 1 year ago 77
SQL Question

accumulating a value in SQL

I am trying to accumulate a value when a certain condition exists such as

If statusCode = 0
then add 1 to a value.

I am trying to show the number of successful records as defined by the statusCode.

There must be a better way to do this.


Answer Source
Select count(1) from yourTable where statusCode=0