删除重复日期及其记录,并仅保留最后的值intable

时间:2017-06-13 14:03:06

标签: mysql

+------------+-------------+-------------+-------------+
| date       | riverbasin1 | riverbasin2 | riverbasin3 |
+------------+-------------+-------------+-------------+
| 2014122500 | undefined   | undefined   | undefined   |
| 2015121300 | 0           | 0           | 0           |
| 2015121400 | 1           | 0           | 0           |
| 2015121500 | 0           | 0           | 0           |
| 2015121600 | 0           | 0           | 0           |
| 2015121700 | 0           | 0           | 0           |
| 2015121800 | 0           | 1           | 0           |
| 2015121900 | undefined   | undefined   | undefined   |
| 2015122000 | 0           | 0           | 0           |
| 2015122100 | 0           | 5           | 6           |
| 2015122200 | 0           | 0           | 0           |
| 2015122300 | 0           | 0           | 0           |
| 2015122300 | 0           | 0           | 1           |
| 2015122400 | 0           | 1           | 1           |
| 2015122400 | 0           | 2           | 1           |
| 2015122400 | 0           | 2           | 0           |
| 2015122500 | undefined   | undefined   | undefined   |
| 2015122600 | 0           | 0           | 0           |
| 2015122700 | 1           | 1           | 0           |
| 2015122900 | undefined   | undefined   | undefined   |
+------------+-------------+-------------+-------------+

MySQL表中有一些重复日期,如20141224002015122300及其riverbasin值中的相应记录

我想只保留与上次重复日期对应的最后一条记录,并删除其他重复日期及其值。

0 个答案:

没有答案