New answers tagged window-functions
0
votes
Accepted
In PostgreSQL how to get the hourly minimum of a value using a window function?
In this query:
SELECT to_char("time", 'YYYY-MM-DD HH'), AVG("Temperature_deg_in_C")
FROM "measurements"
WHERE "time" BETWEEN '2024-11-01' AND '2024-12-01'
GROUP ...
-1
votes
In PostgreSQL how to get the hourly minimum of a value using a window function?
PLPgSQL query using windows function:
SELECT
to_char(time, 'YYYY-MM-DD HH'),
ROUND(
AVG(temperature_deg_in_c) OVER (
PARTITION BY to_char("time", 'YYYY-MM-DD HH'...
Top 50 recent answers are included
Related Tags
window-functions × 346postgresql × 185
sql-server × 88
aggregate × 46
gaps-and-islands × 35
group-by × 22
mysql × 21
t-sql × 21
query-performance × 14
performance × 13
cte × 13
sql-server-2012 × 12
join × 12
oracle × 11
greatest-n-per-group × 11
rank × 11
count × 10
running-totals × 10
sql-server-2008-r2 × 9
sql-server-2014 × 9
query × 9
postgresql-performance × 9
order-by × 8
sql-server-2016 × 7
update × 7