Re: Sql query with partial matching - Mailing list pgsql-general

From Brett W. McCoy
Subject Re: Sql query with partial matching
Date
Msg-id Pine.LNX.4.30.0012121147030.14220-100000@chapelperilous.net
Whole thread Raw
In response to Sql query with partial matching  (Travis Bauer <trbauer@indiana.edu>)
List pgsql-general
On Thu, 7 Dec 2000, Travis Bauer wrote:

> How would I write an sql statement which would select all the
> records from a table where some string field contains
> some substring?  Example: find all the records where f1 contains
> the world "cool."

SELECT * FROM mytable WHERE f1 LIKE '%cool%';

or use a regular expression:

SELECT * FROM mytable WHERE f1 ~* 'cool';

                                     http://www.chapelperilous.net/~bmccoy/
---------------------------------------------------------------------------
"Pascal is Pascal is Pascal is dog meat."
        -- M. Devine and P. Larson, Computer Science 340


pgsql-general by date:

Previous
From: Juriy Goloveshkin
Date:
Subject: ilike and --enable-multibyte=KOI8
Next
From: Zeugswetter Andreas SB
Date:
Subject: AW: Oracle-compatible lpad/rpad behavior