I have a table that stores information from several twitter tweets, including the tweet text and the screen name of the user who tweeted the tweet. Tweets contain hashtags (starting with C #), I want to count the number of hashtags that the user tweeted:
tweet_id | tweet_text | screen_name | -------------------------------------------------------------------------------------------- 1 |
If I counted the hashtags tweeter_user_1, the result I expect is 8, if I need the hashtags tweeter_user_3, it should return 1. How can I do this, assuming my table name is tweets.
I tried this: SELECT COUNT( * ) FROM tweets WHERE( LENGTH( REPLACE( tweet_text, '#%', '@') = 0 ) ) AND screen_name = 'tweeter_user_1' but it did not work
I would be happy if the result of tweeter_user_1 was also 9: D
source share