如何從mysql數據庫中刪除表中的行,刪除後我應該在列中有4個不同的值。從條件刪除mysql
我的數據庫的實際狀態:
+----+-----------+---------+---------------------+
| id | action_id | valeurs | temps_action |
+----+-----------+---------+---------------------+
| 81 | 1 | ON_1 | 2016-04-26 11:14:43 |
| 80 | 2 | OFF_2 | 2016-04-26 11:14:41 |
| 84 | 2 | OFF_2 | 2016-04-26 11:14:48 |
| 83 | 1 | ON_1 | 2016-04-26 11:14:46 |
| 79 | 1 | OFF_1 | 2016-04-26 11:14:40 |
| 78 | 2 | ON_2 | 2016-04-26 11:14:38 |
| 77 | 1 | ON_1 | 2016-04-26 11:14:35 |
| 82 | 2 | OFF_2 | 2016-04-26 11:14:45 |
+----+-----------+---------+---------------------+
我想結束了:
+----+-----------+---------+---------------------+
| id | action_id | valeurs | temps_action |
+----+-----------+---------+---------------------+
| 81 | 1 | ON_1 | 2016-04-26 11:14:43 |
| 80 | 2 | OFF_2 | 2016-04-26 11:14:41 |
| 79 | 1 | OFF_1 | 2016-04-26 11:14:40 |
| 78 | 2 | ON_2 | 2016-04-26 11:14:38 |
+----+-----------+---------+---------------------+
你想保留哪些? – shmosel
可能重複[如何刪除MySQL表上的重複?](http://stackoverflow.com/questions/2630440/how-to-delete-duplicates-on-a-mysql-table) –