SQL WHERE
Filter rows so only records that meet a condition are returned.
How it works
WHERE removes rows that do not match your condition before the final result is returned. It is one of the most important SQL clauses for operational reporting.
Text values are normally quoted. Numbers are not. You can combine conditions with AND and OR, and use parentheses when the logic needs to be explicit.
Filter an inventory export to items below a stock threshold or show only open production orders.
The pattern
SELECT columns
FROM table
WHERE condition;Example
SELECT *
FROM Orders
WHERE Status = 'Open';Run the example
Edit the query and run it against the built-in demo tables. Nothing is sent to a server.
The learning runner supports SELECT, WHERE, LIKE, IN, BETWEEN, GROUP BY, HAVING, JOIN, aggregates, ORDER BY and LIMIT. Advanced lessons explain additional production SQL concepts even when the mini runner does not execute that syntax.
Which operator means greater than or equal to?
Progress is stored only in this browser. No account required.