Running total with tied dates
sales has (d, amt): (01-01, 10), (01-02, 20), (01-02, 30), (01-03, 40). What running total does the query show for the row (01-02, 20)?
SELECT d, amt, SUM(amt) OVER (ORDER BY d) AS running FROM sales;
Discussion 0
Join free to post in the discussion.
Related questions
- Purpose of a primary keyData Engineer
- Row count of a LEFT JOINData Engineer
- Filtering with = NULLData Engineer
- COUNT(*) vs COUNT(column)Data Engineer
- Filtering groups with HAVINGData Engineer
- Adding a number to NULLData Engineer
- Orders pointing to missing customersData Engineer
- Upserting into a target tableData Engineer