我的左表的数据是“消息”完整的数据OG留下其他表,然后加入连接
id advid seller_id purchase _id delete_status
15 93 28 19 yes
22 134 34 19 yes
25 168 15 19 No
17 130 19 2 yes
24 134 34 6 No
我的右表中的数据是“DeleteMessage可以”
id addid sessionid messageid
1 93 19 15
2 134 34 22
3 93 28 15
4 130 19 17
我正在插入ADVID,ID和活动人员(卖方/买方)在session中删除表
现在我想要消息表中的数据,其销售者/购买ID不作为会话标识输入到删除表中
我使用左加入,但它不是从左表保存我的数据
我的查询是
select * from message
left join deletetable
on message.id = deletetable.messageid
where sessionid !='34'
AND (purchase_id='34' OR seller_id='34')
根据我的愿望这个查询应该给我留言表的条目没有24但没有什么是显示出来
不,它是给我从左表的所有34条目 – ramii