Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在同一个表的两列中找到匹配的值,但行不同。
我想要的是值 3 在两列中
请帮忙!
试试这个自我加入:
SELECT DISTINCT t.b FROM your_table t INNER JOIN your_table s ON t.b = s.c AND t.id <> s.id