Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

MS SQL - Number of a specific value within a single row

$
0
0

Hi,

I have a sql table like the above.  I would like to calculate the number of Reds for each row and add it as another column.

For example I would like to add another column called RAG Reds. For ID 1 this would show as 2, for ID 2 this would show as 0.

Does anyone know the SQL command for this?

Thanks,

Mark


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>