From: "Matthew Sleight" <matthewsleight(at)encore-international(dot)net>
To: <pgsql-novice(at)postgresql(dot)org>
Subject:
Date: 2010-07-12 11:31:21
Message-ID: !&!AAAAAAAAAAAYAAAAAAAAAAH5a9EkBUZHk600Og0/ttnCgAAAEAAAAKtl1m1FFrtPj6WemChU4s8BAAAAAA==@encore-international.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

I'm trying to work out how to make an update query work with a join in
posrgre.

I can write it in normal SQL, but postgre comes up with an error on the
first 'inner join'. The online help (that is not very good) makes it seem
like you do not use the 'inner join' at all, but just aggregate; but then
postgre comes up with an error saying this won't work either.

Any hints would be most helpful.

The code I started with is:

UPDATE public_consumption_hanson_uk_el_clear INNER JOIN
public_consumption_hanson2 ON
(public_consumption_hanson_uk_el_clear.supply_day =
public_consumption_hanson2.supply_day) AND
(public_consumption_hanson_uk_el_clear.supply_band_name =
public_consumption_hanson2.supply_band_name) AND
(public_consumption_hanson_uk_el_clear.meterreference =
public_consumption_hanson2.meter_no) AND
(public_consumption_hanson_uk_el_clear.meterpointreference =
public_consumption_hanson2.mpan) SET
public_consumption_hanson_uk_el_clear.actual_estimate =
Min([consumption_hanson2].[actual_estimate]);

Thanks in advance!

Responses

  • Re: at 2010-07-12 16:25:50 from Richard Broersma

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2010-07-12 15:44:10 Re: Join Scalability
Previous Message Jens Wilke 2010-07-11 13:57:29 Re: postgresql and pgadmin3