发出此 sql 请求后:
SELECT user.id, campaign_id, user_id
FROM `user`
LEFT OUTER JOIN `email_solus`
ON email_solus.user_id=user.id
我有这张桌子。
id campaign_id user_id
------ ----------- ---------
1 3 1
1 5 1
1 6 1
2 (NULL) (NULL)
3 (NULL) (NULL)
4 (NULL) (NULL)
5 (NULL) (NULL)
7 (NULL) (NULL)
8 (NULL) (NULL)
9 (NULL) (NULL)
10 (NULL) (NULL)
12 (NULL) (NULL)
13 (NULL) (NULL)
14 (NULL) (NULL)
15 (NULL) (NULL)
16 (NULL) (NULL)
17 (NULL) (NULL)
我想做的是取消选择所有带有campaign_id = 3的元素,以及所有常见的ID。在这种情况下,我需要删除所有 id=1 的元素,有一个像这样的表:
id campaign_id user_id
------ ----------- ---------
2 (NULL) (NULL)
3 (NULL) (NULL)
4 (NULL) (NULL)
5 (NULL) (NULL)
7 (NULL) (NULL)
8 (NULL) (NULL)
9 (NULL) (NULL)
10 (NULL) (NULL)
12 (NULL) (NULL)
13 (NULL) (NULL)
14 (NULL) (NULL)
15 (NULL) (NULL)
16 (NULL) (NULL)
17 (NULL) (NULL)