PostgreSQL でこの SQL クエリを理解するのを手伝ってくれる人はいますか?
SELECT sum(count)
FROM (
SELECT count,
time,
max(time) OVER (PARTITION BY post_id) max_time
FROM totals
WHERE cust_id IN %s
AND time < %s
AND type = %s
) as ss
WHERE time = max_time;