I am trying to count the number of Pass and Fails across several different columns.
For example, I have 10 columns that each result in a value Pass or Fail. I want a query that gives the count of all of each of those columns broken down by # of Pass and # of Fails.
I used this code to count all of the Fails on 1 column:
SELECT COUNT(CO_mtm) AS CO_mtm_FAIL FROM FXCompare
WHERE CO_mtm='FAIL'
This gives me all of the fails for column CO_mtm. However, how can I continue the SQL code to give me the # of fails for all the other columns i.e. CO_log, CO_otm, CO_date, etc. etc.
THANKS.
For example, I have 10 columns that each result in a value Pass or Fail. I want a query that gives the count of all of each of those columns broken down by # of Pass and # of Fails.
I used this code to count all of the Fails on 1 column:
SELECT COUNT(CO_mtm) AS CO_mtm_FAIL FROM FXCompare
WHERE CO_mtm='FAIL'
This gives me all of the fails for column CO_mtm. However, how can I continue the SQL code to give me the # of fails for all the other columns i.e. CO_log, CO_otm, CO_date, etc. etc.
THANKS.
Comment