Find gaps in daily order activity. Identify dates where no orders were placed but the previous and next dates had orders. Use a CTE to generate the range of dates, then find missing ones. Return the gap date, the last date with an order before the gap, and the first date with an order after the gap.
Schema
🔑idINT
🔗customer_idINT
order_dateTEXT
statusTEXT
total_amountREAL
postgresql
Run your query to see results
Press Ctrl + Enter to execute