我有这个 MySQL SELECT:
SELECT t.*,
sum(HOUR(TIMEDIFF(STR_TO_DATE(Arbeitsbeginn, '%d.%m.%Y %H:%i:%s'),
STR_TO_DATE(Arbeitsende, '%d.%m.%Y %H:%i:%s')))) AS ARBEITSZEIT,
sum(HOUR(TIMEDIFF(STR_TO_DATE(Projektbeginn, '%d.%m.%Y %H:%i:%s'),
STR_TO_DATE(Projektende, '%d.%m.%Y %H:%i:%s')))) AS Projektzeit
FROM (SELECT DriverName,
Baustelle,
Arbeitsbeginn,
Arbeitsende,
Projektbeginn,
Projektende
FROM (SELECT DRIVERNAME,
GROUP_CONCAT(IF(ACTIONTEXT = 'PB', AREA, NULL)) AS 'Baustelle',
GROUP_CONCAT(IF(ACTIONTEXT = 'Arbeitsbeginn', DATETIME, NULL)) AS 'Arbeitsbeginn',
GROUP_CONCAT(IF(ACTIONTEXT = 'Arbeitsende', DATETIME, NULL)) AS 'Arbeitsende',
GROUP_CONCAT(IF(ACTIONTEXT = 'PB', DATETIME, NULL)) AS 'Projektbeginn',
GROUP_CONCAT(IF(ACTIONTEXT = 'PE', DATETIME, NULL)) AS 'Projektende'
FROM geoImportRoot
GROUP BY DRIVERNAME
) A CROSS JOIN
(SELECT 1 AS n UNION ALL SELECT 2) n
) t
GROUP BY DriverName;
是否可以将其直接插入新表中?