I'm pulling data from Twitter API into my DB. There is a column 'hashtags' which stores a list of hashtags used in the tweet.
Table name: brexittweets
Column: hashtags varchar(500)
I want to count the number of hashtags. For example
Hashtags
Tweet1: ['EUref', 'Brexit', 'poll']
Tweet2: ['Brexit', 'Blair']
Tweet3: ['Brexit', 'Blair', 'EUref']
Result should be:
hashtag count(hashtag)
Brexit 3
EUref 2
Blair 2
poll 1
What I was thinking of doing: Tried to take substring between quotes ' ', but it occurs multiple times in the same row.
Tried using strpos to find instances of ' ', but it returns only the first instance.
Is there a way to do this with queries? I was thinking of trying out a procedure, but it gets complicated because I need to print these results on a web page using PHP.