Вы можете использовать:
WITH cte AS (
SELECT t.*,
ROW_NUMBER() OVER(ORDER BY daytime) -
ROW_NUMBER() OVER(PARTITION BY "user" ORDER BY daytime) grp
FROM tab t
)
SELECT MIN(daytime) AS daytime, "user", SUM(value) AS value
FROM cte
GROUP BY "user", grp
ORDER BY daytime;
Демо DBFiddle
РЕДАКТИРОВАТЬ:
решение, похоже, не работает, если с одним и тем же пользователем существует разная дата
WITH cte AS (
SELECT t.*,
ROW_NUMBER() OVER(ORDER BY daytime)
- ROW_NUMBER() OVER(PARTITION BY "user" ORDER BY daytime) grp
FROM tab t
), cte2 AS (
SELECT c.*,
CASE WHEN daytime - 1 =
COALESCE(LAG(daytime) OVER(PARTITION BY "user", grp ORDER BY daytime),
daytime-1) THEN 0 ELSE 1 END AS grp2
FROM cte c
), cte3 AS (
SELECT c2.*, SUM(grp2) OVER(PARTITION BY "user", grp ORDER BY daytime) AS s
FROM cte2 c2
)
SELECT MIN(daytime) AS daytime, "user", SUM(value) AS value
FROM cte3
GROUP BY "user", grp, s
ORDER BY "user", grp, daytime;
DBFiddle Demo2