How do I filter rows with a numeric condition in SQL?
SELECT * FROM data
WHERE quantity >= 3
ORDER BY quantity DESC;
Run this query in QueryLocal →
`WHERE` filters rows before any grouping or ordering happens — only rows where the condition evaluates to true make it into the result. `quantity >= 3` keeps bulk orders and drops everything else, which is the SQL equivalent of a spreadsheet AutoFilter but expressed as a single, repeatable line of code.
A table named data with columns: order_id (integer), customer (text), country (text), category (text), quantity (integer), unit_price (real), order_date (text, YYYY-MM-DD).