agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Richard Broersma Jr <rabroersma@yahoo.com>
To: ezequias@fastcon.com.br, Guy Fraser <guy@incentre.net>
To: pgsql-sql@postgresql.org
Subject: Re: Regular Expressions
Date: Tue, 27 Mar 2007 15:16:10 -0700 (PDT)
Message-ID: <150597.94573.qm@web31808.mail.mud.yahoo.com> (raw)
In-Reply-To: <web-47508192@correio2.docasdoporto.com.br>

> 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.




view thread (18+ messages)  latest in thread

Message-ID: <150597.94573.qm@web31808.mail.mud.yahoo.com>
Permalink:  ../150597.94573.qm@web31808.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/150597.94573.qm@web31808.mail.mud.yahoo.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rabroersma@yahoo.com, guy@incentre.net
  Subject: Re: Regular Expressions
  In-Reply-To: <150597.94573.qm@web31808.mail.mud.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox