Example 1
Return orders with amounts between 100 and 300
Order 1 (50) is below the range and order 4 (350) is above it. BETWEEN includes the endpoints — if the data had a row with amount = 100 or amount = 300, it would also be returned.
Source table data Rows loaded before the example query runs.
Setup
CREATE TABLE orders (id INT, amount INT);
INSERT INTO
orders (id, amount)
VALUES
(1, 50),
(2, 150),
(3, 250),
(4, 350);Validated query Shared across supported engines.
SQL
SELECT
id,
amount
FROM
orders
WHERE
amount BETWEEN 100 AND 300
ORDER BY
id;Expected result Returned rows for the shared example.
| id | amount |
|---|---|
| 2 | 150 |
| 3 | 250 |
Output is identical across all engines.