Tuesday, 20 November 2018

MSSQL - Count values in comma separated string



Watch this example on YouTube




Declare @SomeValues varchar(max) = '1,2,3, 4, 4,4,44';
Select Len(@SomeValues) - Len(Replace(@SomeValues, ',', ''))+1

No comments:

Post a Comment