【发布时间】:2010-12-17 07:07:25
【问题描述】:
我有两张桌子...
table1 (id, item, price) 值:
id | item | price
-------------
10 | book | 20
20 | copy | 30
30 | pen | 10
....table2 (id, item, price) 值:
id | item | price
-------------
10 | book | 20
20 | book | 30
现在我想:
update table1
set table1.Price = table2.price
where table1.id = table2.id
and table1.item = table2.item.
我该怎么做?
【问题讨论】:
-
@mrp:您不应该将每个 RDBM 作为标签,因为有人可能会建议您提供一些特定于供应商的解决方案。
标签: sql mysql sql-server oracle