Re: what the problem with this query

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: what the problem with this query
Дата
Msg-id 9724.1145029702@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: what the problem with this query  (Michael Glaesemann <grzm@myrealbox.com>)
Список pgsql-general
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
ASogc_fid FROM (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:  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

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: corrupted item pointer:???
Следующее
От: "Raphael Bauduin"
Дата:
Сообщение: Re: ilike and utf-8