WHERE · dates
Filter orders by month
Which orders were placed in November 2026? Show them in date order.
Compare with the solution
There are four orders, numbered 1005 through 1008.
SELECT id AS pedido_id, fecha FROM pedidos WHERE fecha >= '2026-11-01' AND fecha < '2026-12-01' ORDER BY fecha ASC, id ASC;
| pedido_id | fecha |
|---|---|
| 1005 | 2026-11-02 |
| 1006 | 2026-11-12 |
| 1007 | 2026-11-20 |
| 1008 | 2026-11-24 |