Re: Merging 2 rows in a table

From: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Merging 2 rows in a table
Date: 2011-01-03 14:31:47
Message-ID: AANLkTimh80fxjnEoPCzgOq3h0PEocPsGJEwa++KbP=bU@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you Pavel, has worked:

# update pref_money as m1 set money=money+coalesce((select money from
pref_money as m2 where m1.id=m2.id and m2.yw='2011-52'),0) where
m1.yw='2010-52';
UPDATE 2081

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeremy Harris 2011-01-03 14:39:01 Re: problem updating from form
Previous Message Pavel Stehule 2011-01-03 14:25:11 Re: Merging 2 rows in a table