Re: Sql query with partial matching

From: Steve Heaven <steve(at)thornet(dot)co(dot)uk>
To: Travis Bauer <trbauer(at)indiana(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: Sql query with partial matching
Date: 2000-12-12 16:40:38
Message-ID: 3.0.1.32.20001212164038.00fd0bc4@mail.thornet.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

At 14:58 07/12/00 -0500, 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 table where f1 ~ 'cool';

or case insensitive

select * from table where f1 ~* 'cool';

Steve

--
thorNET - Internet Consultancy, Services & Training
Phone: 01454 854413
Fax: 01454 854412
http://www.thornet.co.uk

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brett W. McCoy 2000-12-12 16:49:22 Re: Sql query with partial matching
Previous Message Steve Heaven 2000-12-12 16:36:10 COPY doesnt work on views