From: venkat <ven.tammineni@gmail.com>
To: pgsql-general@postgresql.org
To: pgsql-sql@postgresql.org
Subject: How to update multiple rows
Date: Tue, 26 Oct 2010 12:37:44 +0530
Message-ID: <AANLkTim4QDfbyss7C_qB=ezUc-ZQiPDDj3qyLUwbCH2L@mail.gmail.com> (raw)
Dear All,
I want to update multiple row in single query.I am trying for below
query.I am getting error as
"ERROR: more than one row returned by a subquery used as an expression
SQL state: 21000"
Here is my Query.
update parcelsdata set gid=(select random() * 10),
kasarano=(select kasarano from parcelsdata),
murabano=(select murabano from parcelsdata),
the_geom = (select
(st_dump(st_polygonize(st_union(st_boundary(the_geom), the_line)))).geom as
the_geom from
(select gid,kasarano,murabano,st_linefromtext('LINESTRING('
||(st_xmin(the_geom)-1)::text||'
'||(st_ymax(the_geom)-the_length)||',
'||st_xmax(the_geom)+1||'
'||st_ymax(the_geom)-the_length||')',24047) as the_line, the_geom from
(select 100 as the_length, * from parcelsdata) a) b
where gid = 113 GROUP BY gid,kasarano,murabano)
where kasarano='1' and murabano='119'
Please let me know.I am waiting for your great response.
Thanks and Regards,
Venkat
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: ven.tammineni@gmail.com, pgsql-general@postgresql.org
Subject: Re: How to update multiple rows
In-Reply-To: <AANLkTim4QDfbyss7C_qB=ezUc-ZQiPDDj3qyLUwbCH2L@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