Thread: what the problem with this query

what the problem with this query

From
venu gopal
Date:
Hi all,
   When i try to run the following query it gives the following error what was wrong in the query.

Query:SELECT o.orgunitname AS ouname, e.entrynumber AS value_field, centroid(c.the_geom) AS the_geom, c.ogc_fid AS ogc_fid FROM (ctrphc AS c INNER JOIN orgunit o ON c.dhs_ouname = o.orgunitname) INNER JOIN (SELECT orgunitid, entrynumber FROM routinedataou4 WHERE dataelementid=1195 AND dataperiodid = 86) AS e ON o.orgunitid = e.orgunitid) AS new_table USING UNIQUE ogc_fid USING SRID=-1

Error::ERROR:  syntax error at or near ")" at character 333

Regards,
venu

Re: what the problem with this query

From
"Guido Barosio"
Date:
o.orgunitid = e.orgunitid)

That ")" is not valid Venu. (Nothing is being enclosed)

Regards,
Guido


On 4/14/06, venu gopal <gopalonline2@yahoo.co.uk> wrote:
>
> Hi all,
>    When i try to run the following query it gives the following error what
> was wrong in the query.
>
> Query:SELECT o.orgunitname AS ouname, e.entrynumber AS value_field,
> centroid(c.the_geom) AS the_geom, c.ogc_fid AS ogc_fid FROM (ctrphc AS c
> INNER JOIN orgunit o ON c.dhs_ouname = o.orgunitname) INNER JOIN (SELECT
> orgunitid, entrynumber FROM routinedataou4 WHERE dataelementid=1195 AND
> dataperiodid = 86) AS e ON o.orgunitid = e.orgunitid) AS new_table USING
> UNIQUE ogc_fid USING SRID=-1
>
> Error::ERROR:  syntax error at or near ")" at character 333
>
> Regards,
> venu
>
>


--
Guido Barosio
-----------------------
http://www.globant.com
guido.barosio@globant.com

Re: [GENERAL] what the problem with this query

From
"William Penberthy"
Date:

IT appears you have one too many closing parans…

 

SELECT o.orgunitname AS ouname, e.entrynumber AS value_field, centroid

(

c.the_geom

)           AS the_geom, c.ogc_fid AS ogc_fid FROM

(

ctrphc AS c INNER JOIN orgunit o ON c.dhs_ouname = o.orgunitname

)           INNER JOIN

(           SELECT orgunitid, entrynumber FROM routinedataou4 WHERE dataelementid=1195 AND dataperiodid = 86

)           AS e ON o.orgunitid = e.orgunitid

)           AS new_table USING UNIQUE ogc_fid USING SRID=-1

 


From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of venu gopal
Sent: Friday, April 14, 2006 5:09 AM
To: pgsql-admin@postgresql.org; pgsql-general@postgresql.org
Subject: [GENERAL] what the problem with this query

 

Hi all,
   When i try to run the following query it gives the following error what was wrong in the query.

Query:SELECT o.orgunitname AS ouname, e.entrynumber AS value_field, centroid(c.the_geom) AS the_geom, c.ogc_fid AS ogc_fid FROM (ctrphc AS c INNER JOIN orgunit o ON c.dhs_ouname = o.orgunitname) INNER JOIN (SELECT orgunitid, entrynumber FROM routinedataou4 WHERE dataelementid=1195 AND dataperiodid = 86) AS e ON o.orgunitid = e.orgunitid) AS new_table USING UNIQUE ogc_fid USING SRID=-1

Error::ERROR:  syntax error at or near ")" at character 333

Regards,
venu


Re: what the problem with this query

From
"Jim C. Nasby"
Date:
On Fri, Apr 14, 2006 at 11:09:16AM +0000, venu gopal wrote:
> Hi all,
>    When i try to run the following query it gives the following error what was wrong in the query.
>
> Query:SELECT o.orgunitname AS ouname, e.entrynumber AS value_field, centroid(c.the_geom) AS the_geom, c.ogc_fid AS
ogc_fidFROM (ctrphc AS c INNER JOIN orgunit o ON c.dhs_ouname = o.orgunitname) INNER JOIN (SELECT orgunitid,
entrynumberFROM routinedataou4 WHERE dataelementid=1195 AND dataperiodid = 86) AS e ON o.orgunitid = e.orgunitid) AS
new_tableUSING UNIQUE ogc_fid USING SRID=-1 
>
> Error::ERROR:  syntax error at or near ")" at character 333

Extra ) after the the last ON.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461