update table1 set price = table2.price
where table1.productId = table2.productId;
(Of course, both tables must have a different name).
:)
Ligia
""[EMAIL PROTECTED]"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This is a multi-part message in MIME format
Hi,
Let say I have 2 Product table, both of them has
columns ProductID and Price
What is the update command if I want to update
all Prices of first table to be equal with Price in second
table?
Please Help.
Yudie
[EMAIL PROTECTED] writes:
> Let say I have 2 Product table, both of them has columns ProductID and
> Price What is the update command if I want to update all Prices of first
> table to be equal with Price in second table?
Possibly you mean something like this:
UPDATE first_table SET price = (SE
On Tue, 2002-09-03 at 17:38, [EMAIL PROTECTED] wrote:
> Let say I have 2 Product table, both of them has columns ProductID and
Price
> What is the update command if I want to update all Prices of first
table to be equal with Price in second table?
UPDATE table1
SET price =
(SELECT pric
Hi,
Let say I have 2 Product table, both of them has
columns ProductID and Price
What is the update command if I want to update
all Prices of first table to be equal with Price in second
table?
Please Help.
Yudie
Tom,
> UPDATE t1 SET amount = (select sum(b.amount) from t2 b
> WHERE t1.id = b.id);
Interesting. I'm used to (not necessarily in PGSQL):
UPDATE t1 SET amount = t2ttl.totalamount
FROM (SELECT sum(amount) as totalamount,
id FROM t2 GROUP BY id) t2ttl
WHERE t1.id = t2.id
Althoug
Carolyn Wong <[EMAIL PROTECTED]> writes:
> I'd like to know what's the correct SQL statement to do the following:
> updatet1 a
> set a.amount = sum(b.amount)
> from t2 b
> where a.id = b.id
Try
UPDATE t1 SET amount = (select sum(b.amount) from t2 b WHERE t1.id = b.id);
Or possibly yo
update t1
set amount = sum(b.amount)
from ts b
where a.id=b.id
On Thursday 18 January 2001 09:54, Carolyn Wong wrote:
> I'd like to know what's the correct SQL statement to do the following:
>
> updatet1 a
> set a.amount = sum(b.amount)
> from t2 b
> where a.id = b.id
I'd like to know what's the correct SQL statement to do the following:
update t1 a
set a.amount = sum(b.amount)
fromt2 b
where a.id = b.id