作者:Yafei2702933480 | 来源:互联网 | 2014-07-09 16:02
oracleusefulsql语句查看表中有木要重复数据selectcolumn1,column2,count(*)fromtablegroupbycolumn1column2havingcount(*)>1;www.2cto.comeg.selectdrill.reportfor,drill.w...
oracle useful sql语句
查看表中有木要重复数据
select column1,column2,count(*) from table group
by column1 column2 having count(*) > 1;
www.2cto.com
eg.
select drill.reportfor, drill.wellbore_id, count(*)
from zj_dailydrillrep drill www.2cto.com
group by drill.reportfor, drill.wellbore_id
HAVING count(*) > 1;