Re: Multiple subquery with insert into command ?

From: reyman <reyman64(at)gmail(dot)com>
To: msi77 <msi77(at)yandex(dot)ru>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Multiple subquery with insert into command ?
Date: 2010-06-07 22:25:42
Message-ID: AANLkTiljDMiCALXO22BFYk5VqSu3Cbsqw6YkRQjR13l8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thx a lot, problem resolved :)

On Mon, Jun 7, 2010 at 6:59 PM, msi77 <msi77(at)yandex(dot)ru> wrote:

> Use the following:
>
> INSERT INTO umzintersect (intersection,umz00_id,pop, comm_id, name_asci)
> SELECT intersection(umz_project.the_geom, lau2.the_geom),
> umz_project.umz00_id, umz_project.pop, lau2.comm_id, lau2.name_asci
> FROM umz_project, lau2,big_umz
> WHERE umz_project.umz00_id = big_umz.umz00_id AND umz_project.the_geom &&
> lau2.the_geom AND umz_project.umz00_id in (23,58);
>
> http://www.sql-ex.ru/help/select11.php
>
> > Hello guys !
> > I have problem with my query, i want to use the multiple insert
> possibility of pgsql...
> > INSERT INTO umzintersect (intersection,umz00_id,pop, comm_id, name_asci)
> > (SELECT intersection(umz_project.the_geom, lau2.the_geom),
> umz_project.umz00_id, umz_project.pop, lau2.comm_id, lau2.name_asci
> > FROM umz_project, lau2,big_umz
> > WHERE umz_project.umz00_id = big_umz.umz00_id AND umz_project.the_geom
> && lau2.the_geom AND umz_project.umz00_id = 23),
> > (SELECT intersection(umz_project.the_geom, lau2.the_geom),
> umz_project.umz00_id, umz_project.pop, lau2.comm_id, lau2.name_asci
> > FROM umz_project, lau2,big_umz
> > WHERE umz_project.umz00_id = big_umz.umz00_id AND umz_project.the_geom
> && lau2.the_geom AND umz_project.umz00_id = 58);
> > I have this error code :
> > ********** Erreur **********
> > ERREUR: erreur de syntaxe sur ou près de « , »
> > État SQL :42601
> > Caractère : 353
> > I don't understand where is my error ...
> > With only one select, the query run, but with two, i have this error..
> > Perhaps insert into with multiple subquery is impossible ? So, how can i
> do this query without loose the GREAT multi query possibility of postgresql
> ?
> > Thanks a lot in advance :)
> > Seb
> >
>
> Яндекс.Почта. Письма есть. Спама - нет. http://mail.yandex.ru/nospam/sign
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ben Morrow 2010-06-08 14:33:27 Casts in foreign schemas
Previous Message msi77 2010-06-07 16:59:44 Re: Multiple subquery with insert into command ?