Skip to content

Tag: string

Concat rows for employee roles

I’m using SQL Server. Looking for similar functionality as GROUP_CONCAT or listagg functions provided in other Databases. Seems like STUFF function is provided to concat rows. Here’s my attempt. Employee Role EmployeeRole Expected Output Answer In SQLServer 2017, you can use aggregate function STR…

Find the count of words in string

SQL: How to find the count of words in following example? Subquestions: How to count spaces? How to count double/triple/… spaces as one? answer by Gordon Linoff here How to avoid counting of special characters? Example: ‘Please , don’t count this comma’ Is it possible without string_sp…