删除重复的行

时间:2017-02-24 17:36:19

标签: mysql

我有两个表“TABLE_A”,“TABLE_B”

     TABLE_A                          TABLE_A
+=======================+        +=======+===============+
| GLID  |      DATE     |        |  TRID |    DATE       |
+=======+===============+        +=======+===============+
| 1     |   13-12-2017  |        |    1  |    13-12-2017 |
| 2     |   13-12-2017  |        |       |               |
| 3     |   13-12-2017  |        |       |               |
| 4     |   13-12-2017  |        |       |               |
| 5     |   14-12-2017  |        |       |               |
+=======+===============+        +=======+===============+

当我们执行查询select TABLE_A.GLID,TABLE_A.DATE,TABLE_B.TRID,TABLE_B.DATE FROM TABLE_A.TABLE_B WHERE TABLE_A.DATE=TABLE.B.DATE;时,我得到了结果

+=======================+=======+===============+
| GLID  |      DATE     |  TRID |    DATE       |
+=======+===============+=======+===============+
| 1     |   13-12-2017  |    1  |    13-12-2017 |
| 2     |   13-12-2017  |    1  |    13-12-2017 |
| 3     |   13-12-2017  |    1  |    13-12-2017 |
| 4     |   13-12-2017  |    1  |    13-12-2017 |
=================================================

如何从第二列中删除重复行并将其设为空repeated rows

0 个答案:

没有答案