rihad wrote:
> Richard Broersma Jr wrote:
> UPDATE Foo foo
> SET ...
> FROM LEFT JOIN Bar bar USING(common_field)
> WHERE blah='blah' AND bar.common_field IS NULL;
>
> ERROR: syntax error at or near "JOIN"
>
>
> I know I'm misusing UPDATE ... FROM because I don't really want Bar's
> values to go into Foo, but only using them for a conditional update
> (atomically I hope).
Oh, you mean:
UPDATE foo
SET ...
WHERE blah = 'blah'
AND NOT EXISTS (
SELECT 1 FROM baz WHERE foo.common_field = baz.common_field
)
--
Alban Hertroys
alban@magproductions.nl
magproductions b.v.
T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
7500 AK Enschede
// Integrate Your World //