oracle查询表中字段里数据是否有重复

查单个字段:

SELECT TEST_NAME,COUNT(*) FROM T_TEST GROUP BY TEST_NAME HAVING COUNT(*) > 1

 

查组合字段:

SELECT TEST_NAME1,TEST_NAME2,COUNT(*) FROM T_TEST GROUP BY TEST_NAME1,TEST_NAME2 HAVING COUNT(*) > 1

 

posted @ 2017-10-24 20:08  忧郁香蕉  阅读(232)  评论(0编辑  收藏  举报