#996

Products That Were Ordered

The catalog flags products that appear at least once in order_items. Rewrite the report in a set-based form and return the unique product id values, sorted by id.

Original query
SELECT p.id FROM products p WHERE EXISTS (SELECT 1 FROM order_items oi WHERE oi.product_id = p.id) ORDER BY p.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
3

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