Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 376E01337999; Tue, 26 Oct 2010 04:07:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 57394-07; Tue, 26 Oct 2010 07:07:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f174.google.com (mail-iw0-f174.google.com [209.85.214.174]) by mail.postgresql.org (Postfix) with ESMTP id B33ED1336FA7; Tue, 26 Oct 2010 04:07:44 -0300 (ADT) Received: by iwn10 with SMTP id 10so1793016iwn.19 for ; Tue, 26 Oct 2010 00:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=OsbaAKcKbgymxOBW8K7NFQKlVdD7zACbSuLAEMh+Yak=; b=runVivhjPYZ+DlMG7CL255pU28yZK5p81FKzZO+jChWcfjUgz+RLWgHIsPm/ufytFr xq/XfP8nOAcDhho7TR7q5aUvjcKAIWx2vmHuaxhxhiLwjzxgkDVWexijtyuvMR6vJ1Gs hfcCeU+y67dBZ7yWUROJQzQqkgsQ5uRoH99tc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=nutDMs/iLgZiFPmCjlfwqetkdt4R4jIRVvLRjHFojWFX5pt19P5WUQL5LLvjef7LdL X0WSY+etPSuehETK4n+Us4VmjQ0py7VfXke1I6Hzs/SehHDN+N2CDxvKPv7lW1qHo8i4 /C6oGMHkw9jAxX6RsElqCffQYOkpRtNF4kAiQ= MIME-Version: 1.0 Received: by 10.42.210.139 with SMTP id gk11mr6217593icb.317.1288076864302; Tue, 26 Oct 2010 00:07:44 -0700 (PDT) Received: by 10.42.159.130 with HTTP; Tue, 26 Oct 2010 00:07:44 -0700 (PDT) Date: Tue, 26 Oct 2010 12:37:44 +0530 Message-ID: Subject: How to update multiple rows From: venkat To: pgsql-general@postgresql.org, pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=20cf303bfc18f0b00204937fc3ac X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-5 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/924 X-Sequence-Number: 168836 --20cf303bfc18f0b00204937fc3ac Content-Type: text/plain; charset=ISO-8859-1 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 --20cf303bfc18f0b00204937fc3ac Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Dear All,

=A0=A0I want to up= date multiple row in single query.I am trying for below query.I am getting = error =A0as
=A0
= "ERROR: more than one row returned by a subquery used as an expression=
SQL state: 21000"

Here is my Query= .

update parcelsdata set gid=3D(select random() * 10),
<= div> =A0 =A0 =A0kasarano=3D(select kasarano from p= arcelsdata),
=A0 =A0 =A0murabano=3D(select murabano fro= m parcelsdata),
=A0 =A0 =A0the_geom =3D (select (st_dump(s= t_polygonize(st_union(st_boundary(the_geom), the_line)))).geom as the_geom = from=A0
(select gid,kasarano,murabano,st_linefromte= xt('LINESTRING('=A0
||(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=A0
(select 100 as the_length, * from parcelsda= ta) a) b
where gid =3D 113 GROUP BY gid,kasarano,mu= rabano)

where kasarano=3D'= ;1' and murabano=3D'119'


Please l= et me know.I am waiting for your great response.

Thanks= and Regards,

Venkat
--20cf303bfc18f0b00204937fc3ac--