Finding strings inside a field...

From: Dan Delaney <dionysos(at)dionysia(dot)org>
To: PostgreSQL SQL Discussion <pgsql-sql(at)postgresql(dot)org>
Subject: Finding strings inside a field...
Date: 1998-06-29 21:28:02
Message-ID: Pine.BSF.3.96.980629172405.6263I-100000@dionysia.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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';

What do I need to do to get all the record that have "foobar"
ANYWHERE within the "description" field?
Thanks a lot.
--Dan

-----------------------------------------------------------------------
Daniel G. Delaney The Louisville Times Chorus
Dionysos(at)Dionysia(dot)org www.LouisvilleTimes.org
www.Dionysia.org/~dionysos/ Dionysia Design
ICQ Number: 8171285 www.Dionysia.com/design/
-----------------------------------------------------------------------
I doubt, therefore I might be.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Brett W. McCoy 1998-06-29 21:36:20 Re: [SQL] Finding strings inside a field...
Previous Message James Olin Oden 1998-06-29 19:27:51 Re: [SQL] gmake not found