需要从表中获取特定行但查询返回多行
MYSQL
SELECT DISTINCT
id, sender_id, msg, name, profilepic, cur_time, cur_date
FROM `chat`
WHERE
(sender_id = '1' AND receiver_id = '3')
OR
(sender_id = '3' AND receiver_id = '1')
AND
chat.id > '3'
表格样本:
id | sender_id | receiver_id | msg | name | profilepic
1 1 3 hi Jay o.jpg
2 1 3 hey Jay o.jpg
3 3 1 hi Tom o.jpg
4 1 3 Yes Jay o.jpg
我期望查询的行是第 4 行,id 为“4”,但查询一直返回其他几行