I used the below way before looking at your solution: with cte as (select unnest(string_to_array(content, ' ')) as word from google_files) select word,count(word) as word_count from cte where word in ('SQL', 'PySpark') group by word Thanks for the solution, I learned 2 new functions.
I used the below way before looking at your solution:
with cte as
(select
unnest(string_to_array(content, ' ')) as word
from google_files)
select word,count(word) as word_count
from cte
where word in ('SQL', 'PySpark')
group by word
Thanks for the solution, I learned 2 new functions.
👏
could you please make alternate solution in mysql ?
In pg u can use unnest function along with json with a delimiter of a space to get the word together