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

1、查找单个字段

select 字段名,count(*) from table group by 字段名 having count(*) > 1

2、查找组合字段:

SELECT TEST_NAME1,TEST_NAME2,COUNT(*) FROM table GROUP BY TEST_NAME1,TEST_NAME2 HAVING COUNT(*) > 1
posted @ 2016-11-02 15:58  lhd0525  阅读(24199)  评论(0编辑  收藏  举报