Skip to content
Advertisement

Counting the number of words in a Column in Oracle SQL

How do you group this data, based on Patterns? Is it possible in SQL?

So, I have a table like this, Imagine there is 500000 rows and 4800 brand names.

The 4800 brand names can either be the first word, second word, third word or last word.

One possible way to solve this would be to get the substrings and count them, and Order by count(pattern) desc where rownum < 4800;

Now I need to find the count of the words (Eg: Apple, Samsung, Motorola)

Desired output is shown below:

enter image description here

Advertisement

Answer

The answer to this data set is below:

Answer:

enter image description here

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement