Filtering the Data from Tables

Learn about filtering when retrieving data from a database.

Sometimes, we need to filter the table to find data that meets certain criteria. To retrieve the data we need, we can add a WHERE clause to our SELECT statement:

SELECT Column1, Column2, Column3
FROM TableSchema.TableName
WHERE [Condition]

The condition is a boolean expression (a comparison result). Similar to other programming languages, comparisons in T-SQL are made with the help of comparison operators.

Get hands-on with 1200+ tech skills courses.