Write a SQL query to identify the most common path users take through a funnel. Each user's path should contain the distinct funnel steps they reached, ordered by the funnel's defined step order. Ignore events with an unknown step or missing user ID.
path, user_count, and path_rankpath| Column | Type | Description |
|---|---|---|
| step_codePK | VARCHAR(40) | Stable identifier for a funnel step |
| step_name | VARCHAR(100) | Display name of the funnel step |
| step_order | INT | Canonical order of the step in the funnel |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique funnel event identifier |
| user_id | VARCHAR(30) | Identifier of the user who generated the event |
| step_code | VARCHAR(40) | Funnel step associated with the event |
| event_at | TIMESTAMP | Timestamp when the event occurred |