How many orders each buyer has

How many orders each buyer has

One buyer can place many orders, and each of them keeps the buyer's id in orders.user_id. For every buyer who has orders, return user_id and the number of their orders as orders_count, ordered by user_id ascending.

Row order matters

PostgreSQLv16

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid