Norse
Norse

Reputation: 5757

MySQL Find a line of text in a LONGTEXT column

How can you return the line of a paragraph from a LONGTEXT column, if you know what the line of text starts with?

SELECT 
SUBSTRING('\nA line of text starts here', `paragraphs`)
FROM books

Upvotes: 1

Views: 660

Answers (1)

Ratzor
Ratzor

Reputation: 317

By using "LIKE". % indicates that more characters can follow.

SELECT paragraphs FROM books WHERE paragraphs LIKE '\nA line of text starts here%'

Upvotes: 2

Related Questions