pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedwhat the problem with this query
6+ messages / 6 participants
[nested] [flat]
* what the problem with this query
@ 2006-04-14 11:09 venu gopal <gopalonline2@yahoo.co.uk>
2006-04-14 11:26 ` Re: [GENERAL] what the problem with this query William Penberthy <bpenberthy@scarpatechnology.com>
2006-04-14 11:31 ` Re: what the problem with this query Guido Barosio <gbarosio@gmail.com>
2006-04-14 11:36 ` Re: what the problem with this query Michael Glaesemann <grzm@myrealbox.com>
2006-04-21 01:31 ` Re: what the problem with this query Jim C. Nasby <jnasby@pervasive.com>
0 siblings, 4 replies; 6+ messages in thread
From: venu gopal @ 2006-04-14 11:09 UTC (permalink / raw)
To: pgsql-admin; pgsql-general@postgresql.org
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
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [GENERAL] what the problem with this query
2006-04-14 11:09 what the problem with this query venu gopal <gopalonline2@yahoo.co.uk>
@ 2006-04-14 11:26 ` William Penberthy <bpenberthy@scarpatechnology.com>
3 siblings, 0 replies; 6+ messages in thread
From: William Penberthy @ 2006-04-14 11:26 UTC (permalink / raw)
To: 'venu gopal' <gopalonline2@yahoo.co.uk>; pgsql-admin; pgsql-general@postgresql.org
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
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: what the problem with this query
2006-04-14 11:09 what the problem with this query venu gopal <gopalonline2@yahoo.co.uk>
@ 2006-04-14 11:31 ` Guido Barosio <gbarosio@gmail.com>
3 siblings, 0 replies; 6+ messages in thread
From: Guido Barosio @ 2006-04-14 11:31 UTC (permalink / raw)
To: venu gopal <gopalonline2@yahoo.co.uk>; +Cc: pgsql-admin; pgsql-general@postgresql.org
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
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: what the problem with this query
2006-04-14 11:09 what the problem with this query venu gopal <gopalonline2@yahoo.co.uk>
@ 2006-04-14 11:36 ` Michael Glaesemann <grzm@myrealbox.com>
2006-04-14 15:48 ` Re: what the problem with this query Tom Lane <tgl@sss.pgh.pa.us>
3 siblings, 1 reply; 6+ messages in thread
From: Michael Glaesemann @ 2006-04-14 11:36 UTC (permalink / raw)
To: venu gopal <gopalonline2@yahoo.co.uk>; +Cc: pgsql-general <pgsql-general@postgresql.org>
On Apr 14, 2006, at 20:09 , venu gopal wrote:
> 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
[please don't post HTML]
I'm not familiar with the syntax you're using, but one problem is
that your parentheses are not balanced -- there's an extra closing
parenthesis. That's probably what the error is complaining about. You
might want to try to use whitespace to see the structure of your
query better, e.g.,
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
Hope this helps a bit.
Michael Glaesemann
grzm myrealbox com
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: what the problem with this query
2006-04-14 11:09 what the problem with this query venu gopal <gopalonline2@yahoo.co.uk>
2006-04-14 11:36 ` Re: what the problem with this query Michael Glaesemann <grzm@myrealbox.com>
@ 2006-04-14 15:48 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2006-04-14 15:48 UTC (permalink / raw)
To: Michael Glaesemann <grzm@myrealbox.com>; +Cc: venu gopal <gopalonline2@yahoo.co.uk>; pgsql-general <pgsql-general@postgresql.org>
Michael Glaesemann <grzm@myrealbox.com> writes:
> I'm not familiar with the syntax you're using, but one problem is
> that your parentheses are not balanced -- there's an extra closing
> parenthesis. That's probably what the error is complaining about. You
> might want to try to use whitespace to see the structure of your
> query better, e.g.,
Also, consider using a newer Postgres release. 8.0 and up provide
a cursor pointer so that you don't have to count characters:
regression=# 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: syntax error at or near ")" at character 333
LINE 1: ...taperiodid = 86) AS e ON o.orgunitid = e.orgunitid) AS new_t...
^
regression=#
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: what the problem with this query
2006-04-14 11:09 what the problem with this query venu gopal <gopalonline2@yahoo.co.uk>
@ 2006-04-21 01:31 ` Jim C. Nasby <jnasby@pervasive.com>
3 siblings, 0 replies; 6+ messages in thread
From: Jim C. Nasby @ 2006-04-21 01:31 UTC (permalink / raw)
To: venu gopal <gopalonline2@yahoo.co.uk>; +Cc: pgsql-admin; pgsql-general@postgresql.org
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_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
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
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2006-04-21 01:31 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-04-14 11:09 what the problem with this query venu gopal <gopalonline2@yahoo.co.uk>
2006-04-14 11:26 ` William Penberthy <bpenberthy@scarpatechnology.com>
2006-04-14 11:31 ` Guido Barosio <gbarosio@gmail.com>
2006-04-14 11:36 ` Michael Glaesemann <grzm@myrealbox.com>
2006-04-14 15:48 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-04-21 01:31 ` Jim C. Nasby <jnasby@pervasive.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox