我在数据库里放了很多行,我有:
+----+---------------------+-------------+----------------+-----------+
| ID | time | os_name | program | last_line |
+----+---------------------+-------------+----------------+-----------+
| 14 | 2019-01-04 14:00:00 | titi | roro | 109 |
| 15 | 2019-01-04 14:00:00 | titi | roro | 109 |
| 16 | 2019-01-04 14:00:00 | gege | fefe | 109 |
我想要:
+---------------------+-------------------------+-------------+-----------+-----------+
| time | nb_os_name_program | os_name | program | last_line |
+---------------------+-------------------------+-------------+-----------+-----------+
| 2019-01-04 14:00:00 | 2 | titi | roro | 109 |
| 2019-01-04 14:00:00 | 1 | gege | fefe | 109 |
1条答案
按热度按时间epfja78i1#
简单
GROUP BY
通过聚合可以帮助您: