[sql]批次更新資料使用子查詢 sql update using subquery
語法:
UPDATE `tableA` SET `tableA`.code = (
SELECT `tableB`.code
FROM `tableB`
WHERE `tableA`.id = `tableB`.id
)
不懂可提問:)
REF http://stackoverflow.com/questions/14618703/update-query-using-subquery-in-sql-server
REF http://stackoverflow.com/questions/14618703/update-query-using-subquery-in-sql-server