MySQL查询删除位于ExpressionEngine中三个表中的200,000个垃圾邮件成员

时间:2012-06-25 13:01:32

标签: mysql expressionengine

我的某个ExpressionEngine网站遇到垃圾邮件会员问题。我已经浏览了受影响的成员组,并记下了我想要保存的每个成员的member_id号码。我希望从同一个group_id中删除所有其他成员。成员数据存储在3个不同的表中。这是我正在寻找的等式,但在MySQL查询语言中:

FROM tables = exp_member_data, exp_member_homepage, exp_members<br>
IF group_id = 5<br>
AND NOT member_id = 5, 6, 10, 107, 267, etc... <br>
DELETE remaining rows

非常感谢任何帮助!!

<小时/> 的 *修改

谢谢@Romil

这是最终结果,因为group_id不在两个表中:

DELETE FROM `exp_member_homepage`, `exp_member_data`
WHERE member_id not in ( 5, 10, 11, 15 )

***** be sure to add members from ALL member groups

DELETE FROM `exp_members`
WHERE group_id = 5
AND member_id not in ( 5, 10, 11, 15 )

2 个答案:

答案 0 :(得分:3)

Delete from mytable where  group_id = 5
AND member_id not in ( 5, 6, 10, 107, 267)

答案 1 :(得分:0)

我找到的最佳方法是ExpressionEngine社区成员Bhashkar Yadav的Sidd3