它们都有 fileId 和 userId 字段
表1: 文件ID 用户ID 表2: 文件ID 用户ID如果表 2 中不存在表 1 中的所有行,我想根据其 fileId 和 userId 删除它们。不只是一个字段,而是两个字段都删除...
亲切的问候, J
最佳答案
delete from table2
where fileid not in (select fileid from table1)
and userId not in (select userId from table1)
关于php - 如果不在表 1 中,则根据 2 个字段从表 2 中删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11411320/