Distinct pages per user

Distinct pages per user

From sessions(user_id, page), for each user_id build a sorted array of the distinct pages they visited. Output columns user_id and pages (an ascending-sorted array of distinct page values). Order the result by user_id ascending.

Row order matters

PostgreSQLv16

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid