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

📱Build WhatsApp Bot using .NET + OpenAI

   In this article, you will learn how to build a real-world WhatsApp chatbot using ASP.NET Core and OpenAI. This bot can automatically repl...