MySQL update不能直接使用select的結(jié)果 |
| 發(fā)布時間: 2012/8/20 17:27:20 |
|
在sql server中,我們可是使用以下update語句對表進行更新: update a set a.xx= (select yy from b) where a.id = b.id ; 但是在mysql中,不能直接使用set select的結(jié)果,必須使用inner join: update a inner join (select yy from b) c on a.id =b.id set a.xx = c.yy 本文出自:億恩科技【www.liangzihuyu.com】 |
京公網(wǎng)安備41019702002023號