Re: Textmatchning

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "A B" <gentosaker(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Textmatchning
Date: 2008-09-17 20:09:42
Message-ID: dcc563d10809171309m55c99992r78dcb5d230284b56@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Sep 17, 2008 at 12:36 PM, A B <gentosaker(at)gmail(dot)com> wrote:
> Hi.
> 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;
>
> but that will not give me a row in the case when a = 'foo' and b='FOOTBALL'
> and I want that to be a match.
>
> So how do I rewrite my expression? I can't find any way to add % to
> make it match the way I want.

where b ilike '%'||a||'%';

?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Edoardo Panfili 2008-09-17 20:12:36 Re: Textmatchning
Previous Message Tom Lane 2008-09-17 20:07:59 Re: 8.3.3 stability ?