|
I am trying to count all my errors but cant figure out the best way of doing this. I have 25 columns of different errors anything that is not null is an error. I want to count everything that is not null ending with one total for each dept sql code based on 2 columns of errors is below. any advice on this would be great many thanks in advance
(comments are locked)
|
|
Are the error columns numeric? If not, try something like as the inner query
(comments are locked)
|
|
I would recommend sticking with COUNT, as it will filter out the NULL values automatically. If you don't need any additional joins, you could do this without a subquery. This way you wouldn't need to add/remove columns in two places if you needed to make a change.
(comments are locked)
|

