cindi cindi - 11 months ago 30
SQL Question

How to count instances of character in SQL Column

I have an sql column that is a string of 100 'Y' or 'N' characters. For example:


What is the easiest way to get the count of all 'Y' symbols in each row.


if ms sql

SELECT LEN(REPLACE(myColumn, 'N', '')) FROM ...