SpinTheMic
Pro

Explain it in 60 seconds

ROWS vs RANGE in window frames

Data Engineering · SQL · Intermediate

What is the difference between ROWS and RANGE in a window frame?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • ROWS counts physical rows around the current row.
  • RANGE groups rows with the same ORDER BY value together.
  • With ties, RANGE includes all tied rows in the frame.
  • Default frame with ORDER BY is RANGE UNBOUNDED PRECEDING to CURRENT ROW.
  • Use ROWS for predictable running totals.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics