#995

Users With Paid Orders

Marketing is building a list of users who have at least one order with status = 'paid'. Rewrite the report without the nested list check and return unique user id values sorted by id.

Original query
SELECT u.id FROM users u WHERE u.id IN (SELECT user_id FROM orders WHERE status = 'paid') ORDER BY u.id

Várt kimeneti minta

Így néz ki egy helyes válasz — a sorszáma a sajátja, nem kell egyeznie a sématáblákkal.

id
1
2

A lekérdezésed eredménye itt jelenik meg