Longest Streak of Consecutive Ordering Months

hard
Unit 24 · Window Functions & Cohorts0/0 to milestone

For each customer who has ordered, return name and longest_streak: the longest run of consecutive calendar months in which they placed at least one order. Several orders in the same month count once.

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
query.sql · SQLite
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Longest Streak of Consecutive Ordering Months · TechGradify