我想更新從一個表到另一個行,兩者具有相同的結構,我用這個查詢如何從另一個表中更新一個表?
UPDATE bh_master_ritesh_stock AS st
SET st.tag_uid = apprv.tag_uid ,st.stk_id = apprv.stk_id
FROM bh_stock_approval AS apprv
WHERE st.stock_id = apprv.stock_id
,但它給了我這個錯誤,
You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near
'FROM bh_stock_approval as apprv WHERE st.stock_id = apprv.stock_id' at line 3
哪裏是我的錯?或者我使用錯誤的查詢?
你還是使用連接的可讀性 –
的問題是在哪裏錯誤..如果問題是如何有效地查詢是應該而使用連接:) –