Re: [SQL] Finding strings inside a field...

From: "Tim J Trowbridge" <trowbrid(at)execpc(dot)com>
To: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Finding strings inside a field...
Date: 1998-06-29 21:39:37
Message-ID: 199806292139.QAA20652@earth.execpc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Dan Delaney wrote:
>
> Hello all.
> Could any one tell me if the following is possible using
> PostgreSQL?
>
> I want to be able do a SELECT and search for a string INSIDE OF a
> field. So, say I want to get all record in testtable which contain
> the word "foobar" inside the "description" attribute. The following
> will only get those records in which the "description" attribute
> contains ONLY the word "foobar":
>
> SELECT FROM testtable WHERE description='foobar';

Try this:

SELECT FROM testtable WHERE description like '%foobar%';

Note that this isn't case insensitive.

--
Tim J Trowbridge trowbrid(at)writeme(dot)com
Interested in my genealogy? http://www.execpc.com/~trowbrid

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message CJB 1998-06-29 21:46:04 Re: [SQL] gmake not found
Previous Message Brett W. McCoy 1998-06-29 21:36:20 Re: [SQL] Finding strings inside a field...