pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedMultiple subquery with insert into command ?
3+ messages / 2 participants
[nested] [flat]
* Multiple subquery with insert into command ?
@ 2010-06-07 16:22 reyman <reyman64@gmail.com>
2010-06-07 16:59 ` Re: Multiple subquery with insert into command ? msi77 <msi77@yandex.ru>
0 siblings, 1 reply; 3+ messages in thread
From: reyman @ 2010-06-07 16:22 UTC (permalink / raw)
To: pgsql-sql
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Multiple subquery with insert into command ?
2010-06-07 16:22 Multiple subquery with insert into command ? reyman <reyman64@gmail.com>
@ 2010-06-07 16:59 ` msi77 <msi77@yandex.ru>
2010-06-07 22:25 ` Re: Multiple subquery with insert into command ? reyman <reyman64@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: msi77 @ 2010-06-07 16:59 UTC (permalink / raw)
To: reyman <reyman64@gmail.com>; pgsql-sql
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Multiple subquery with insert into command ?
2010-06-07 16:22 Multiple subquery with insert into command ? reyman <reyman64@gmail.com>
2010-06-07 16:59 ` Re: Multiple subquery with insert into command ? msi77 <msi77@yandex.ru>
@ 2010-06-07 22:25 ` reyman <reyman64@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: reyman @ 2010-06-07 22:25 UTC (permalink / raw)
To: msi77 <msi77@yandex.ru>; +Cc: pgsql-sql
Thx a lot, problem resolved :)
On Mon, Jun 7, 2010 at 6:59 PM, msi77 <msi77@yandex.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
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2010-06-07 22:25 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-06-07 16:22 Multiple subquery with insert into command ? reyman <reyman64@gmail.com>
2010-06-07 16:59 ` msi77 <msi77@yandex.ru>
2010-06-07 22:25 ` reyman <reyman64@gmail.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