Re: Textmatchning

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "A B" <gentosaker(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Textmatchning
Date: 2008-09-17 21:13:00
Message-ID: 6e33892f-56be-4d00-ad48-1561146da276@mm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

A B wrote:

> I would like to compare two columns a and b and find all cases where
> a is a part of b, like this
> select * from mytable where a ilike b;

"a is a part of b" can simply be expressed as:
position(a in b)>0
and if you need case insensitivity:
position(upper(a) in upper(b))>0

Best regards,
--
Daniel
PostgreSQL-powered mail user agent and storage:
http://www.manitou-mail.org

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ben 2008-09-17 21:20:08 Re: updating to 8.3.x
Previous Message Scott Marlowe 2008-09-17 20:58:10 updating to 8.3.x