I have a SQL table like this showing queries users have run and the start time and end times of the queries.
+-----------------+----------+------------+----------+
| QUERY_TEXT | USER_NAME| START_TIME | END_TIME |
+-----------------+----------+------------+----------+
| SELECT * FROM ..| analyst | 03:02:22 | 03:05:35 |
| USE .. | engineer | 03:03:22 | 03:03:24 |
| SELECT NAME .. | engineer | 03:03:24 | 03:04:28 |
| UPDATE .. | analyst | 03:05:35 | 03:06:39 |
| SHOW .. | admin | 03:07:01 | 03:07:05 |
| INSERT .. | analyst | 03:06:39 | 03:08:22 |
| COMMIT; | analyst | 03:08:22 | 03:10:01 |
| DESCRIBE .. | analyst | 03:13:44 | 03:13:46 |
+-----------------+----------+------------+----------+
I want to combine the queries that are time consecutive to get the full scripts run by users. The end result should look like this
+------------------+----------+------------+----------+
| QUERY_TEXT | USER_NAME| START_TIME | END_TIME |
+------------------+----------+------------+----------+
| SELECT .. COMMIT;| analyst | 03:02:22 | 03:10:01 |
| USE .. | engineer | 03:03:22 | 03:04:28 |
| SHOW .. | admin | 03:07:01 | 03:07:05 |
| DESCRIBE .. | analyst | 03:13:44 | 03:13:46 |
+------------------+----------+------------+----------+
I have found answers combining time consecutive states but not one which will concatenate the values of a column as well