Opethian Opethian - 9 months ago 37
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.


Select count(1) from yourTable where statusCode=0