mysql left join修改字段
mysql left join
当ctable中没与materials表中匹配的记录时,修改materials的up为1
1 | UPDATE materials m left join ctable c on m.Id = c.Id SET m.up = 1 |
删除table2中table1_id为空的记录
1 | DELETE t2 |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 张拓的博客!
1 | UPDATE materials m left join ctable c on m.Id = c.Id SET m.up = 1 |
1 | DELETE t2 |