I have data that looks like this:
movie_id comment 1 tom cruise is great 1 great action movie 2 got teary eyed 2 great cast 1 tom cruise is hott
I need a function that returns the most common words in the comments, depending on which movie you choose. Therefore, if I request movie_id = 1, I would get:
tom, 2 cruise, 2 is, 2 great, 2 hott, 1 action, 1 movie, 1
While I request movie_id = 2, I get:
got, 1 teary, 1 eyed, 1 great, 1 cast, 1
I saw some solutions using tsql, but I have never used this before and did not understand the code. Looking for a way to do this in sqlite3.
source share