Answer the question
In order to leave comments, you need to log in
Finding a sentence in a text using SQL?
Actually, the task is to isolate the sentence where the search phrase occurs using SQL in my case, MySQL and Sqlite.
For example:
Search field
"This is a test case for search. This sentence contains the search word. This is completely unnecessary."
Search query sentence
Expected result phrase
This sentence contains the search word
Answer the question
In order to leave comments, you need to log in
SELECT LEFT( Text, LOCATE( 'поиска', Text ) + LENGTH ('поиска') - 1)
FROM Texts
WHERE Text LIKE '%поиска%'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question