DB2
👁 0

Q: How to use window functions?

Answer:
ROW_NUMBER() OVER (PARTITION BY col ORDER BY col2). RANK, DENSE_RANK for rankings. SUM/AVG/COUNT OVER for running totals. PARTITION BY groups within result. ORDER BY within partition. Powerful analytics.