Tom Lane wrote:
> Patrick JACQUOT <patrick.jacquot@anpe.fr> writes:
> > I found a simpler way to do the job I wanted done
>
> > UPDATE t1 SET balance = balance+t2.amount WHERE EXISTS (SELECT *
> > FROM t2 WHERE t2.id = t1.id)
>
> > DOES WORK PROPERLY.
>
> Does it? I don't think that this will do what you are expecting,
<snip>
I thank you very much for your advice. I didn't try indeed to
put more than one line in T2.
I tried before to use your approach bu i used the wrong syntax :
UPDATE t1 SET Balance=Balance+(SELECT Amount FROM t2 WHERE t2.id=t1.id);
which gave me 'parser : parser error near select'.
I am really sorry havig done such a mistake, and apologize
Next time i'll turn my tongue seven times in my mouth before
going to my keyboard.
Best regards
P. Jacquot