Re: Selecting rows having substring in a column [RESOLVED]

2019-08-29 Thread Rich Shepard
On Thu, 29 Aug 2019, Rich Shepard wrote: Aha! I thought of 'like' but forgot about ilike. That's exactly what I need. 'thought' is the wrong word. I should have written that I once knew of like and had forgotten it. Rich

Re: Selecting rows having substring in a column

2019-08-29 Thread Rob Sargent
On 8/29/19 8:47 AM, Rich Shepard wrote: On Thu, 29 Aug 2019, Gary Cowell wrote: Look at the 'LIKE' function Gary, Yes, I thought of like but didn't think to look for it in the postgres manual. Thank you very much, Rich I've given up on the "likes" in favour of the ~ (tilde) and ~* (til

Re: Selecting rows having substring in a column

2019-08-29 Thread Rich Shepard
On Thu, 29 Aug 2019, Gary Cowell wrote: Look at the 'LIKE' function Gary, Yes, I thought of like but didn't think to look for it in the postgres manual. Thank you very much, Rich

Re: Selecting rows having substring in a column [RESOLVED]

2019-08-29 Thread Rich Shepard
On Thu, 29 Aug 2019, Adrian Klaver wrote: test=# select * from like_test where fld_1 ilike '%Winding River%'; fld_1 Adrian, Aha! I thought of 'like' but forgot about ilike. That's exactly what I need. Thanks very much, Rich

Re: Selecting rows having substring in a column

2019-08-29 Thread Gary Cowell
Look at the 'LIKE' function select * from Fishes where stream_trib like '%Winding River%'; You need to 'bookend' your string with '%' for 'LIKE' function, if the string could match anywhere. If it could only be at the end, you could use '%Winding River' If case is an issue, wrap it with upper (o

Re: Selecting rows having substring in a column

2019-08-29 Thread Adrian Klaver
On 8/29/19 7:13 AM, Rich Shepard wrote: Using postgres-11.1 here. My SQL knowledge needs expanding and my web searches have not found a satisfactory answer. I hope to learn the correct approach here. A table (Fishes) has an attribute column stream_trib with values such as Small Creek trib t

Selecting rows having substring in a column

2019-08-29 Thread Rich Shepard
Using postgres-11.1 here. My SQL knowledge needs expanding and my web searches have not found a satisfactory answer. I hope to learn the correct approach here. A table (Fishes) has an attribute column stream_trib with values such as Small Creek trib to Winding River Roaring River