1. 程式人生 > >查詢某兩列重複sql

查詢某兩列重複sql

SELECT  * from RMPSY_XQRMPSY t1 ,RMPSY_XQRMPSY t2 where t1.juror_id=t2.juror_id AND
t1.ah=t2.ah GROUP BY t1.juror_id,t1.ah HAVING count(*)>=2

其中juror_id 和ah不是主鍵