Saturday, October 5, 2013

Count the Comma Separated Values in SQL SERVER

this is usefull when you write data like(abc,zxy)in table



SELECT
      LEN(field name) - LEN(REPLACE(field name, ',', ''))+1 total

From [your table name]



SELECT
      LEN(word) - LEN(REPLACE(word, ',', ''))+1 total

From dbo.test

No comments:

Post a Comment

Opps Part 1 : Abstraction

  Abstraction in C# is a fundamental concept of object-oriented programming (OOP) that allows developers t...