Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select first n lines of a text field

Status
Not open for further replies.

stasJohn

Programmer
May 6, 2004
155
US
Just wondering if there is a way to do this using mysql.

I want to only grab the first 3 lines of a field. A line being any number of characters ending with an endline (\n).

For instance, the following entry is in a field...
This is a sentence.
No, don't go in there.
80's music is definetly a guilty pleasure.
This is not a sentence.
Hi.

I would only want to retrieve...
This is a sentence.
No, don't go in there.
80's music is definetly a guilty pleasure.


MySQL has a left function, but that returns n characters.

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top