Write a query for each order's latest state in the last hour, excluding delivered orders.
Unlock detailed company stats for this questionUpgrade
Given order state transitions with timestamps, where the states are Created, Confirmed, Reached Merchant, Reached Customer and Delivered, write a query to fetch all order IDs with their latest state in the last 1 hour, excluding orders that are already delivered.
Expect follow-ups like
- How would this query behave at scale?
- What indexes would you add?
Community answers
No answers contributed by the community yet.
Related questions
Write a SQL query for each bond's highest, average and lowest interest where the average exceeds 3%.Related courses

Course

Course
Course
