我有这些数据。谁能帮我把它们合二为一?
id employeeID date timein timeout timein1 timeout1
1 12286 2016-09-10 08:08:00 00:00:00 00:00:00 00:00:00
2 12286 2016-09-10 00:00:00 12:08:32 00:00:00 00:00:00
3 12286 2016-09-10 00:00:00 00:00:00 12:41:54 00:00:00
4 12286 2016-09-10 00:00:00 00:00:00 00:00:00 17:10:05
5 12286 2016-10-10 07:41:05 00:00:00 00:00:00 00:00:00
6 12286 2016-10-10 00:00:00 12:15:00 00:00:00 00:00:00
7 12286 2016-10-10 00:00:00 00:00:00 12:35:15 00:00:00
8 12286 2016-10-10 00:00:00 00:00:00 00:00:00 17:15:15
这是我想要的输出。帮助我。由于
id employeeID date timein timeout timein1 timeout1
1 12286 2016-09-10 08:08:00 12:08:32 12:41:54 17:10:05
2 12286 2016-10-10 07:41:05 12:15:00 12:35:15 17:15:15
如果是我,我可能会采用大致如下的模式:
id employeeID datetime activity
1 12286 2016-09-10 08:08:00 in
2 12286 2016-09-10 12:08:32 out
3 12286 2016-09-10 12:41:54 in
4 12286 2016-09-10 17:10:05 ...
不带id字段的临时解决方案
select employeeID, date, max(timein), max(timeout), max(timein1), max(timeout1)按employeeID,日期分组
最好将Insert查询修改为null,而不是