SELECT USERID, ACCOUNTID, DEVID, PROTOCOL FROM PASS_DEVICE_ACCOUNT_AUTH_USER
GROUP BY USERID, ACCOUNTID, DEVID, PROTOCOL HAVING COUNT(*) > 1;
DELETE t1 FROM PASS_DEVICE_ACCOUNT_AUTH_USER AS t1
INNER JOIN PASS_DEVICE_ACCOUNT_AUTH_USER AS t2
WHERE
t1.SEQ < t2.SEQ AND
t1.USERID = t2.USERID AND
t1.ACCOUNTID = t2.ACCOUNTID AND
t1.DEVID = t2.DEVID AND
t1.PROTOCOL = t2.PROTOCOL;
SELECT COUNT(USERID, ACCOUNTID, DEVID, PROTOCOL) FROM PASS_DEVICE_ACCOUNT_AUTH_USER;
