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
Vzorec pričakovanega izhoda
Tako izgleda pravilen odgovor — ima svoje število vrstic in se ni treba ujemati s tabelami sheme.
| id |
|---|
| 1 |
| 2 |
| 3 |
Prijavite se za ogled zgodovine oddaj
PrijavaPrijavite se za uporabo mentorja UI
Prijava