当前位置:数据库 > Oracle >>

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

oracle查询表中字段里数据是否有重复
 
 查单个字段:
 
Sql代码  
SELECT TEST_NAME,COUNT(*) FROM T_TEST GROUP BY TEST_NAME HAVING COUNT(*) > 1  

 

 
 查组合字段:
 
Sql代码  
SELECT TEST_NAME1,TEST_NAME2,COUNT(*) FROM T_TEST GROUP BY TEST_NAME1,TEST_NAME2 HAVING COUNT(*) > 1  

 

 
 
 
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,