Re: Regular Expressions

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: ezequias(at)fastcon(dot)com(dot)br, Guy Fraser <guy(at)incentre(dot)net>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Regular Expressions
Date: 2007-03-27 22:16:10
Message-ID: 150597.94573.qm@web31808.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Could you give me a hand ?
>
> I have a ZipCode table and my address table
>
> I just would like to find out all matches that my zipcode table has where my
> address table appears like this:
>
> Elmo Street, 30
>
> I would like my SQL find out all matches we can find 'Elmo', 'Street'.
>

select zipcode
from zipzodetable
where address ~ 'Elmo'
and address ~ 'Street';

If the query is too slow I expect that installing the tsearch2 contrib module and using the
tsearch2 type queries would give you want you wanted but in a fraction of the time.

Regards,
Richard Broersma Jr.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Phillip Smith 2007-03-27 22:17:00 Re: Foreign Unique Constraint
Previous Message ezequias 2007-03-27 20:01:50 Re: Regular Expressions