groupby query on json type
Posted by: N R
Date: November 09, 2016 07:46AM

I need to group json elements across db rows

the query I am using is :

select JSON_EXTRACT(m.content,'$.m.tags[*].wrd') as word, count(*) as count
from m group by word order by count desc

the result I get is

["#utmp", "#seasiders"] 5
["embeddedurl", "#IMDb", "#nowwatching"] 4
["YouTube", "embeddedurl"] 4
["#seasiders", "embeddedurl"] 4

I need individual word / tokens :

["Thanks"] 3
["seriously"] 2
["#doh"] 2

I guess JSON_EXTRACT(m.content,'$.m.tags[---?--]) is incorrect?

Options: ReplyQuote


Subject
Views
Written By
Posted
groupby query on json type
1436
N R
November 09, 2016 07:46AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.