Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 5659F9FB429 for ; Fri, 27 Oct 2006 12:26:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 08587-06 for ; Fri, 27 Oct 2006 15:25:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.234]) by postgresql.org (Postfix) with ESMTP id 8CFEE9FB3E0 for ; Fri, 27 Oct 2006 12:25:12 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id 55so184148wri for ; Fri, 27 Oct 2006 08:25:11 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=H3Eqj8pxvQn6C51V218vrc1/fhD8mILgUHfvBc6aVhc8HdsyuMoa+SCW2HqLThPGmf3CSaogIpblYxCH5ClVCeSSuzvOaY0+skg3VbJzqZFLRd6WgVo45XdXlHa1ApJCjdxR7VmFcCYojU0JkSrtn+pX4njP/uZ2eC/LxbL09qU= Received: by 10.78.204.20 with SMTP id b20mr4024854hug; Fri, 27 Oct 2006 08:25:10 -0700 (PDT) Received: by 10.78.136.6 with HTTP; Fri, 27 Oct 2006 08:25:10 -0700 (PDT) Message-ID: Date: Fri, 27 Oct 2006 10:25:10 -0500 From: "Aaron Bono" To: "vamsee movva" Subject: Re: not able to execute query on spatial database. Cc: pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_39281_22726729.1161962710807" References: X-Google-Sender-Auth: 3f839d11dacb8b3f X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.496 tagged_above=0 required=5 tests=HTML_40_50, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/221 X-Sequence-Number: 26610 ------=_Part_39281_22726729.1161962710807 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/27/06, vamsee movva wrote: > > Hello all, > I am working with spatial tables. i have two spatial data > tables, one represents the whole state and another table represents the > damaged locations in the state. My aim is to find number of damaged > locations in every county or parish. > Here i am giving the query i used to do this, could you please tell me > whether i am doing right thing or not. > > select count(*) from damagedlocations l1,county l2 where (l2.the_geom and > l1.the_geom) and l2.parishid=particular_parishid; > > thanks in advance. > vamsee movva > What is your table structure? I think you mean (l2.the_geom = l1.the_geom). If you use l2.parishid=particular_parishid then you are not going to get EVERY country or parish. Have you run this query? If so, what are you getting, is it right and if so why not? -- ================================================================== Aaron Bono Aranya Software Technologies, Inc. http://www.aranya.com http://codeelixir.com ================================================================== ------=_Part_39281_22726729.1161962710807 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/27/06, vamsee movva <vamseejump@gmail.com> wrote:
Hello all,
           I am working with spatial tables. i have two spatial data tables, one represents the whole state and another table represents the damaged locations in the state. My aim is to find number of damaged locations in every county or parish.
Here i am giving the query i used to do this, could you please tell me whether i am doing right thing or not.

select count(*) from damagedlocations l1,county l2 where (l2.the_geom and l1.the_geom) and l2.parishid=particular_parishid;

thanks in advance.
vamsee movva

What is your table structure?  I think you mean (l2.the_geom = l1.the_geom) .  If you use l2.parishid=particular_parishid then you are not going to get EVERY country or parish.

Have you run this query?  If so, what are you getting, is it right and if so why not?


--
==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
   http://codeelixir.com
================================================================== ------=_Part_39281_22726729.1161962710807--