Statuses as One List
The operations filter looks for orders with status = 'paid' or status = 'pending', but the condition has grown into repeated checks of the same field. Rewrite it as one allowed-status list and return order id values in ascending order.
Original query
SELECT id FROM orders WHERE status = 'paid' OR status = 'pending' ORDER BY id
Esempio di output atteso
Ecco come appare una risposta corretta — il suo numero di righe è a sé stante, non deve corrispondere alle tabelle dello schema.
| id |
|---|
| 10 |
| 11 |
| 12 |
Accedi per vedere la cronologia degli invii
AccediAccedi per usare l'AI Mentor
Accedi