1.查询数据表中重复的数据
mysql> SELECT Sensor_ID FROM SensorAttr where Sensor_ID in (SELECT Sensor_ID FROM Sensorbase group by Sensor_ID HAVING COUNT(Sensor_ID)>1);
2.查询数据表中不重复的数据 ,DISTINCT
SELECT DISTINCT(Sensor_ID) FROM SensorAttr ;
1.查询数据表中重复的数据
mysql> SELECT Sensor_ID FROM SensorAttr where Sensor_ID in (SELECT Sensor_ID FROM Sensorbase group by Sensor_ID HAVING COUNT(Sensor_ID)>1);
2.查询数据表中不重复的数据 ,DISTINCT
SELECT DISTINCT(Sensor_ID) FROM SensorAttr ;