如何使用didmd5分组选择event_type

时间:2018-06-01 11:44:15

标签: mysql

 events_id | didmd5                          | article_id | event_type | count | datetime   | last_updated        |
+-----------+---------------------------------+------------+------------+-------+------------+---------------------+
|         1 | f8fdf8b7315c884b87361a4dd73d878 |          5 | share      |     1 | 2018-06-01 | 2018-06-01 08:40:40 |
|         2 | f8fdf8b7315c884b87361a4dd73d878 |          5 | like       |     1 | 2018-06-01 | 2018-06-01 08:42:26 |
|         3 | f8fdf8b7315c884b87361a4dd73d878 |          5 | read       |     1 | 2018-06-01 | 2018-06-01 08:42:33 |
|         4 | f8fdf8b7315c884b87361a4dd73d878 |          5 | readmore   |     2 | 2018-06-01 | 2018-06-01 08:47:07 |

1 个答案:

答案 0 :(得分:0)

如果您想在一行中使用不同的event_type,可以尝试:

SELECT didmd5, group_concat(event_type) from TABLE group by didmd5;