SQL Server query to calculate number of A in string

Amatya
Posted by Amatya under Sql Server category on | Points: 40 | Views : 2635
SQL Server query to calculate number of A in string 'DOTNETFUNDA-AMATYA'.

  Select LEN('DOTNETFUNDA-AMATYA') - LEN (REPLACE('DOTNETFUNDA-AMATYA', 'A', '')) as ACount


Output
4


Thanks
Amatya

Comments or Responses

Login to post response