📜  更新具有 mysql 代码示例

📅  最后修改于: 2022-03-11 15:05:30.131000             🧑  作者: Mango

代码示例1
UPDATE contacts_domains cd, 
 (SELECT id FROM contacts_domains GROUP BY domain_id
   HAVING COUNT(contact_id) = 1) AS cdtmp
SET cd.dominant = 1
WHERE cd.id = cdtmp.id