0

I have a table of tweets stored in the body field of the table. I run the following SQL query to check whether the tweet has an @mention:

SELECT username, created, body FROM mytable WHERE body REGEXP '@([a-zA-Z0-9\_\.]+)' ; 

It works, and it gets me the rows that match the REGEXP. Is it possible to just return the @mentions in the body rather than the entire body (same as the python re.findall() function? The table is big and doing analysis on all of it is taking too long, and all I really need are the @mentions from each body field.

4
  • 1
    This is similiar to: stackoverflow.com/questions/4021507/…. Commented Oct 14, 2015 at 13:27
  • do you need to count the occurrences of @mention in each row? Commented Oct 14, 2015 at 13:42
  • No, I just need the name(s) of the @mention in each row Commented Oct 14, 2015 at 14:01
  • There is no simple way to extract a part of body based on a regexp. Commented Oct 16, 2015 at 1:51

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.