码迷,mamicode.com
首页 > 其他好文 > 详细

从数据表中筛选重复的数据

时间:2016-05-16 12:36:11      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:

If you want to find duplicate data (by one or several criterias) and select the actualrows.

This should also work, maybe give it try. SELECT id, COUNT(id) FROM table1 GROUP BY id HAVING COUNT(id)>1;

I think this will work properly to search repeated values in a particular column.

SELECT gid_Sensorinfo, COUNT(gid_Sensorinfo)
FROM rel_testareasensor 
GROUP BY gid_Sensorinfo 
HAVING COUNT(gid_Sensorinfo)>1;

 

从数据表中筛选重复的数据

标签:

原文地址:http://www.cnblogs.com/chucklu/p/5497367.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!