I have a column which contains captions to images. What I want to do is find the most popular words occurring in that column.
Is there a way to do this with t-sql?
I have a column which contains captions to images. What I want to do is find the most popular words occurring in that column.
Is there a way to do this with t-sql?
I think you can do something like this. I don't think this is the most optimized, but you can improve on it.
Create a table variable @t to store the words Create a cursor, loop through each row in your captions table. for each row, use the chunk split function to get a table (http://www.sommarskog.se/arraylist-2005/tblnum-functions.html#chunk_split_me) add the words from the table to the table variable @t
Do a word and count(word) and order descending on @t .