Created
February 26, 2024 21:14
-
-
Save waquwex/e33816b978a2f9631e76996b694ff7cc to your computer and use it in GitHub Desktop.
T-SQL Get Word Count of Text Column (STRING_SPLIT)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| id, | |
| name, | |
| COUNT(value) AS WordCount | |
| FROM | |
| Peoples | |
| CROSS APPLY | |
| STRING_SPLIT(name, ' ') | |
| GROUP BY | |
| id, name | |
| ORDER BY | |
| WordCount desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment