Search code examples
sqlsybase

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


Solution

  • Select count(1) from yourTable where statusCode=0