Monday, October 12, 2015

To find duplicates on field.

SELECT [KodeSupplier], COUNT(*) as duplicate
    FROM [TBL_KODESUPPLIER]
    GROUP BY KodeSupplier 
HAVING      (COUNT(*) > 1)

KodeSupplier    duplicate
001.swadaya         2
1.0000.0000.0000    2
1.0000.0000.0001    2
1.0000.0000.GM01    2
1.0000.0000.GM02    2
1.ABZDZ.CDZZ.305    2
1.ABZZ.BZZZ.3113    2
1.ABZZ.BZZZ.3114    2
1.ABZZ.BZZZ.3116    2
1.ABZZ.BZZZ.3117    2
1.ABZZ.BZZZ.3118    2
1.ABZZ.BZZZ.3119    2
1.ABZZ.BZZZ.3120    2
1.ABZZ.BZZZ.3121    2
1.ABZZ.BZZZ.3122    2
1.ABZZ.BZZZ.3123    2
1.ABZZ.BZZZ.3124    2
1.ABZZ.CDZZ.3041    2

No comments: