Example 1
Find rows for one city
WHERE city = 'London' trims the result set before sorting, so only matching rows appear in the final output.
Source table data Rows loaded before the example query runs.
Setup
CREATE TABLE offices (id INT, city VARCHAR(50));
INSERT INTO
offices (id, city)
VALUES
(1, 'London'),
(2, 'Berlin'),
(3, 'London');Validated query Shared across supported engines.
SQL
SELECT
id,
city
FROM
offices
WHERE
city = 'London'
ORDER BY
id;Expected result Returned rows for the shared example.
| id | city |
|---|---|
| 1 | London |
| 3 | London |
Validated on all four engines with the same column names and row order.