>_ QueryLocal All recipes
SQL recipe

How do I filter rows where quantity is at least 2 in SQL?

SELECT * FROM data
WHERE quantity >= 2
ORDER BY quantity DESC;
Run this query in QueryLocal →

`WHERE quantity >= 2` keeps only the rows whose quantity meets or exceeds 2, discarding the rest before any sorting happens. Changing the number on the right of `>=` is all it takes to tighten or loosen the filter.

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).