我有一个问题:
SELECT DISTINCT *
FROM table1 AS s
LEFT OUTER JOIN table2 AS t
ON s.s_id = t.t_id
WHERE (
s.body LIKE '%string%'
OR t.name LIKE '%string%'
)
ORDER BY s.time DESC
但我仍然得到重复的元组。这是为什么?
答案 0 :(得分:0)
GROUP BY s.s_id
是解决方案。
答案 1 :(得分:0)