1. 程式人生 > >SQL技能

SQL技能

查詢表中某兩列值重複的行

例子

select * from relation_map a
where exists (
select 1
from relation_map b
where b.primary_id = a.primary_id
and (a.slave_id<> b.slave_id)
)

學自:https://bbs.csdn.net/topics/390358838