Re: [SQL] How to retrieve N lines of a text field.

2004-01-29 Thread Joe Conway
Chris Travers wrote: This is a complex issue, and i am tryign to figure out how to use regular expressions to resolve this issue. I need to retrieve the first N lines of a text field. N would be assigned using a parameterized query, if possible. How 'bout something like this: CREATE OR REPLACE F

Re: [SQL] How to retrieve N lines of a text field.

2004-01-29 Thread Tom Lane
"Chris Travers" <[EMAIL PROTECTED]> writes: > However, this always selects every line but the final one (because %\n seems > to be interpreted to be the largest possible string, while I want it to be > the smallest possible string). I don't think you can solve this in SQL99 regular expressions, bu

[SQL] How to retrieve N lines of a text field.

2004-01-29 Thread Chris Travers
Hi all; This is a complex issue, and i am tryign to figure out how to use regular expressions to resolve this issue. I need to retrieve the first N lines of a text field. N would be assigned using a parameterized query, if possible. I had thought about using something like: select substring(tes