Write a query to detect duplicate events in a clickstream log and return only the earliest timestamp for each unique session.
Treat rows with the same non-null session_id and event_name as duplicate events. Return sessions containing at least one duplicate event group, with the earliest timestamp across all events in each affected session.
session_id and earliest_timestampsession_id ascending| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique identifier for the clickstream event |
| session_id | VARCHAR(50) | Identifier for the user session |
| event_name | VARCHAR(100) | Name of the clickstream event |
| event_timestamp | TIMESTAMP | Timestamp when the event occurred |