pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: reyman <reyman64@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Multiple subquery with insert into command ?
Date: Mon, 7 Jun 2010 18:22:55 +0200
Message-ID: <AANLkTin0ZdbpNswGyO5dkS7cVH2euTpjulqN2aekyWCL@mail.gmail.com> (raw)

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

view thread (3+ messages)  latest in thread

Message-ID: <AANLkTin0ZdbpNswGyO5dkS7cVH2euTpjulqN2aekyWCL@mail.gmail.com>
Permalink:  ../AANLkTin0ZdbpNswGyO5dkS7cVH2euTpjulqN2aekyWCL@mail.gmail.com/
Also on:    postgresql.org/message-id/AANLkTin0ZdbpNswGyO5dkS7cVH2euTpjulqN2aekyWCL@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: reyman64@gmail.com
  Subject: Re: Multiple subquery with insert into command ?
  In-Reply-To: <AANLkTin0ZdbpNswGyO5dkS7cVH2euTpjulqN2aekyWCL@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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