Over Partition
Returning richer context
ID | NAME | DEPARTMENT | CALL_TIME
---|-------|------------|-----------
1 | Alice | Service | 253
2 | Bob | Service | 414
3 | Cathy | Sales | 306AVERAGE(t.call_time) OVER (
PARTITION BY t.id
) AS 'agent_aht'
,AVERAGE(t.call_time) OVER )
PARTITION BY t.department
) AS 'department_aht'
FROM table1 tSUM(acc.amount) OVER (
PARTITION BY acc.account_id
ORDER BY acc.datetime DESC
,acc.account_id DESC
ROWS BETWEEN UNBOUNDED PRECEDIING --from the start
AND 1 PRECEDING --to this row
)Last updated