Suggest an editImprove this articleRefine the answer for “How do you filter rows by condition?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)Filtering rows by condition in SQL is done with the `WHERE` keyword, letting you select only the records that match a given criterion - comparing values, `AND`/`OR` for several conditions, `IN` for set membership, or `LIKE` for pattern matching. **Key point:** `WHERE` is applied before grouping (`GROUP BY`) and sorting (`ORDER BY`), and conditions can be combined for precise filtering.Shown above the full answer for quick recall.Answer (EN)ImageFiltering rows by condition in SQL is done with the **keyword** `WHERE`. It lets you select only the records that match a given criterion. **Syntax:** ```sql SELECT Column1, Column2, ... FROM Table_Name WHERE Condition; ``` ### Example conditions 1. **Comparing against a specific value:** ```sql SELECT * FROM Employees WHERE Age = 30; ``` - Selects every employee whose `Age` equals 30. 2. **Greater than or less than:** ```sql SELECT * FROM Employees WHERE Age > 25; ``` - Selects employees older than 25. 3. **Several conditions (**`AND`**,** `OR`**):** ```sql SELECT * FROM Employees WHERE Age > 25 AND DepartmentID = 101; ``` - Selects employees older than 25 who work in department 101. 4. **Checking set membership (**`IN`**):** ```sql SELECT * FROM Employees WHERE DepartmentID IN (101, 102, 103); ``` - Selects employees working in departments 101, 102, or 103. 5. **Pattern matching (**`LIKE`**):** ```sql SELECT * FROM Employees WHERE Name LIKE 'A%'; ``` - Selects employees whose names start with the letter "A". **Notes:** - `WHERE` is applied before grouping (`GROUP BY`) and sorting (`ORDER BY`). - Different conditions can be combined for precise filtering. > Put simply, `WHERE` lets you **select only the rows** that match certain rules or criteria.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.