簡體   English   中英

mysql用另一個表中的數據更新一個表

[英]mysql update one table with data from another

我收到此更新聲明的問題:

update customers
set customers.email = initialsynctemptable.thinkEmail,
    customers.packages = initialsynctemptable.thinkPackages 
FROM customers INNER JOIN initialsynctemptable
ON  customers.id = initialsynctemptable.customerID

並正在使用mySQL。 在FROM字詞下有一條彎曲的線。 本質上,我試圖用另一個表(initialsynctemptable)中的數據來更新一個表(客戶)。 感謝您

嘗試

UPDATE customers c INNER JOIN 
       initialsynctemptable i ON  c.id = i.customerID
   SET c.email = i.thinkEmail,
       c.packages = i.thinkPackages 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM