帮帮我:)
表A 商品编号,价格
表B 销售单号,商品编号,销售价格
我现在想根据A表中的价格更新B表中的销售价格!
A : sp_id price
00001 10
00002 15
00002 16
00003 6
00003 5
B: xs_id sp_id xs_price
xs001 00002 23
xs002 00003 4
xs003 00002 22
所要结果是B: (根据A表中商品的最高价格来更新B表中相应的商品销售价格(xs_price)
xs_id sp_id xs_price
xs001 00002 16
xs002 00003 6
xs003 00002 16
SQL语句该怎么写呢?谢谢!