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

Thanks

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