例子:
a表 字段 id price
b表 字段 id num
我想 把a表中的price update为 a.price*b.num where a.id=b.id
这个sql语句怎么写?
以前在sql server中写过,但在oracle中 有问题?
a表 字段 id price
b表 字段 id num
我想 把a表中的price update为 a.price*b.num where a.id=b.id
这个sql语句怎么写?
以前在sql server中写过,但在oracle中 有问题?
set a.price = (select a.price*b.num from b where a.id = b.id);试试看~~
set a.price = (select a.price*b.num from b where a.id = b.id)
where exists
(select '1' from b where a.id=b.id);
update (select a.id,a.price,b.num from a,b where a.id=b.id) set price=price*num