string - How to count instances of character in SQL Column -


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

YYNYNYYNNNYYNY ...

What is the easiest way to get the number of 'Y' symbols in each line?

If MS SQL

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

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -