#1066

Buyers Without Repeats

CRM needs a list of users who have at least one order. Do not repeat the same buyer, and guest orders without user_id should produce one separate row. Return user_id in ascending order, placing the empty value last.

Expected output sample

This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.

user_id
1
2
3

Your query result will appear here