Explicit Status List
The operations report needs orders that are not paid, which in this data means pending and cancelled. Rewrite the filter as an explicit list of needed statuses and keep sorting by id.
Original query
SELECT * FROM orders WHERE status <> 'paid' ORDER BY id
Δείγμα αναμενόμενης εξόδου
Έτσι μοιάζει μια σωστή απάντηση — το πλήθος γραμμών της είναι δικό της, δεν χρειάζεται να ταιριάζει με τους πίνακες του σχήματος.
| id | status | user_id | created_at |
|---|---|---|---|
| 13 | pending | 3 | 2024-02-05T14:00:00 |
| 14 | cancelled | 4 | 2024-02-06T16:00:00 |
| 15 | pending | 2 | 2024-02-07T11:00:00 |
Συνδεθείτε για να δείτε το ιστορικό υποβολών
ΣύνδεσηΣυνδεθείτε για να χρησιμοποιήσετε τον AI Mentor
Σύνδεση