Order count per user
Order count per user
From sales(id, user_id, product, amount, ts) count how many order rows belong to each user. Group by user_id and return columns user_id and orders (number of rows). Order by user_id ascending.
Expected output sample
| user_id | orders |
|---|---|
| 10 | 4 |
| 20 | 3 |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inFocus radio
Paused · SomaFM · Fluid