Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 612FE9FB580 for ; Tue, 27 Mar 2007 19:16:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 43525-07 for ; Tue, 27 Mar 2007 19:16:09 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from web31808.mail.mud.yahoo.com (web31808.mail.mud.yahoo.com [68.142.207.71]) by postgresql.org (Postfix) with SMTP id 736A49FB552 for ; Tue, 27 Mar 2007 19:16:13 -0300 (ADT) Received: (qmail 94655 invoked by uid 60001); 27 Mar 2007 22:16:10 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=a5bpdnwt55936CrKOEX5kDfpHWKMJ0TeAMZtWdqWoOCLWr/Qyc8v92ILB8iJErtkdxqn/C3fL6aienjLNmSS5Yt7NlHOQhAG9x3PVALghV7WED2ZuswwtM/h5FsoNXyvrWzRs6dhjjyj5+JuyNuWXu7vQ9Vnn1Io6/PScVF1zno=; X-YMail-OSG: .zfqPT8VM1mqk_cYyIrOLn903GZNCEt9y.i7DD9z9uENVk7MaDjPuaty7510qQUU9fWxzw-- Received: from [63.203.180.122] by web31808.mail.mud.yahoo.com via HTTP; Tue, 27 Mar 2007 15:16:10 PDT Date: Tue, 27 Mar 2007 15:16:10 -0700 (PDT) From: Richard Broersma Jr Subject: Re: Regular Expressions To: ezequias@fastcon.com.br, Guy Fraser , pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <150597.94573.qm@web31808.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.628 tagged_above=0 required=5 tests=AWL, BAYES_05, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS X-Spam-Level: * X-Archive-Number: 200703/324 X-Sequence-Number: 27962 > 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.