SQL - Query to bring two-word messages

Asked

Viewed 18 times

-2

You guys, good night.

I have a BD (mysql) with some tweets stored in a text column. I’m trying to put together a query that returns messages with certain "compound words," but it’s not working. I tried with like and I’m reading about Regex to see if I can, but still no success. Someone can give a help?

Table data

Messages from the table:

Msg 1: I am studying to learn SQL Msg 2: I study to pass the year Msg 3: The study for the contest is in progress Msg 4: I will study to learn SQL Msg 5: I study with my friend to pass the contest.

The intention is to take all variations of the verb to study with followed by certain prepositions. With like I tried...

like %Estud% and like %pr% - The idea is to bring only the verb study + ' '+ preposition, then bring Msg 1 to 4. But it brings the 5 and should not.

I’m studying on regex to see if I can get something, but so far unsuccessful.

Can someone help me?

  • "But he brings the 5 and should not." But the 5 has "Estud" and has "pr", because it should not bring?

  • Because I only want occurrences that have "verb" + space + preposition. In this there are other words between verb and preposition and not only space

  • But precisely, you have to make this clear in the body of the question, without people having to analyze and reread. To understand what kind of question serves the site and, consequently, avoid closures and negativities worth reading What is the Stack Overflow and the Stack Overflow Survival Guide in English. You can [Dit] and simplify posting (preferably with a [mcve]) that it automatically goes to a community vote to reopen or not.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.