update join SQL question

update join SQL question

Post by wkouc » Wed, 05 Jul 2006 13:52:33


I've got 2 tables.

table a
id amount
== ======
1 0
2 0

table b
id year amount
== ==== ======
1 2006 100
2 2006 90
2 2005 70
2 2004 60

after this update statement is performed

update a
set a.amount = b.amount
from
a
join b on a.id = b.id

what is the amount of id 2 of table a? 60, 70 or 90?
I expect 90, how to force the amount equals to 90?
 
 
 

update join SQL question

Post by Riki Wik » Fri, 07 Jul 2006 05:34:40

Hoi

You need to repost your message on the Borland news server to make
everybody see it and possibly answer your message.

How to post to Delphi newsgroups:
< http://www.yqcomputer.com/ ;