查找表中多余的重复记录(多个字段)
SELECT
*
FROM
sirseikssi_jh
WHERE
SIRSEIK_GTD LIKE '%202109%'
AND (SIRSAKI_ID,KRNT_CD, KOMK_NM,TK_HRT,SU,ZI_KB,KNGK_ZIK,KNGK_ZIN,SHZI_RATE,SHZI,ENT_DATE) IN (
SELECT
SIRSAKI_ID,KRNT_CD, KOMK_NM,TK_HRT,SU,ZI_KB,KNGK_ZIK,KNGK_ZIN,SHZI_RATE,SHZI,ENT_DATE
FROM
sirseikssi_jh
WHERE
SIRSEIK_GTD LIKE '%202109%'
GROUP BY
SIRSAKI_ID,KRNT_CD, KOMK_NM,TK_HRT,SU,ZI_KB,KNGK_ZIK,KNGK_ZIN,SHZI_RATE,SHZI,ENT_DATE
HAVING
count(*) > 1
)
ORDER BY
KOMK_NM DESC