From: Tim J Trowbridge <trowbrid@execpc.com>
To: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Finding strings inside a field...
Date: Mon, 29 Jun 1998 16:39:37 -0500 (CDT)
Message-ID: <199806292139.QAA20652@earth.execpc.com> (raw)
In-Reply-To: <Pine.BSF.3.96.980629172405.6263I-100000@dionysia.org>
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@writeme.com
Interested in my genealogy? http://www.execpc.com/~trowbrid
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: trowbrid@execpc.com
Subject: Re: [SQL] Finding strings inside a field...
In-Reply-To: <199806292139.QAA20652@earth.execpc.com>
References: <Pine.BSF.3.96.980629172405.6263I-100000@dionysia.org> <199806292139.QAA20652@earth.execpc.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox