Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id DA8969FB87C for ; Wed, 28 Mar 2007 09:07:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 25953-06 for ; Wed, 28 Mar 2007 09:07:48 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from correio2.docasdoporto.com.br (22.144.199.200.docasdoporto.com.br [200.199.144.22]) by postgresql.org (Postfix) with ESMTP id 2A1449FB5F2 for ; Wed, 28 Mar 2007 09:07:51 -0300 (ADT) Received: from [201.32.161.79] (account ezequias@fastcon.com.br) by correio2.docasdoporto.com.br (CommuniGate Pro WebUser 4.1.8) with HTTP id 47565318; Wed, 28 Mar 2007 09:25:41 -0300 From: Subject: Re: Regular Expressions [progress] To: Richard Broersma Jr ,pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro WebUser Interface v.4.1.8 Date: Wed, 28 Mar 2007 09:25:41 -0300 Message-ID: In-Reply-To: <150597.94573.qm@web31808.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format="flowed" Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/328 X-Sequence-Number: 27966 Richards and List, Now I find out the 'similar to' statement where I can do such search, but I must still parse all substrings. Here is my stage: Select * from myAddressTable where address similar to ('%(ELMO|ST.|258)%') But I still need to Separete all strings. Could someone help me in this crusade ? Regards Ezequias Em Tue, 27 Mar 2007 15:16:10 -0700 (PDT) Richard Broersma Jr escreveu: >> 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. > > >---------------------------(end of broadcast)--------------------------- >TIP 6: explain analyze is your friend -- Ezequias Rodrigues da Rocha