BNA8/.resources/a6ac2c3e3630f2ce032a7ffbd751876e557da860562725e6cac5d0266f5d964a
2025-08-18 15:23:02 +04:00

18 lines
349 B
Plaintext

WITH GAYLORDS AS (
SELECT
MIN(timestamp) AS start_timestamp,
MAX(timestamp) AS end_timestamp,
gaylord_id AS gaylord,
SUM(count) AS count
FROM gl_history
WHERE timestamp BETWEEN :startDate AND :endDate
GROUP BY gaylord_id
ORDER BY gaylord_id
)
SELECT
start_timestamp,
end_timestamp,
gaylord,
/* Counts: */
count
FROM GAYLORDS;