Consecutive Day Orders

Start Timer

0:00:00

Upvote
6
Downvote
Save question
View comments

Given an orders table, write a query to find the customers who placed orders on two consecutive days during July 2026. Return each qualifying customer_id once.

Note: A customer qualifies if they have at least one order on a given day and another order on the immediately following day, where both days fall in July 2026.

Example:

Input:

orders table

Column Type
id INTEGER
customer_id INTEGER
order_date DATE
amount FLOAT

Output:

Column Type
customer_id INTEGER
.
.
.
.
.


Comments

Loading comments