報(bào)錯(cuò)原因:mysql規(guī)定了;upload子查詢(xún)問(wèn)題,不能像我這樣寫(xiě),這是mysql目前的版本缺陷我是這樣寫(xiě)道:UPDATE vote_items set times=((SELECT times from vote_items where id=2)+1) WHERE id=2;上網(wǎng)查有兩種解決方發(fā)1,子查詢(xún)里的表起個(gè)別名2;創(chuàng)建個(gè)臨時(shí)的表但00000000000------------------------------------------兩種我有種沒(méi)法下手,不會(huì),求給條生路吧,嚶嚶嚶?。。。?!詳情如下[SQL]-- SELECT times from vote_items where id=2-- UPDATE vote_items set times=(100+1) WHERE id=2;-- UPDATE vote_items set times=((SELECT times from vote_items where id=2)+1) WHERE id=2;UPDATE vote_items set times=((SELECT times from vote_items where id=2)+1) WHERE id=2;[Err] 1093 - You can't specify target table 'vote_items' for update in FROM clause
添加回答
舉報(bào)
0/150
提交
取消
