Using Where clause in T-SQL Query

If you want to restrict the results of the query to only the records that you need instead of returning all the records from the table , you can use the WHERE clause to filter the records.

You can simply specify the WHERE clause and also specify the conditions that the rows must meet.

How to Filter records using WHERE clause in SQL Server ?

For example , if you want to return the rows where the department name is ‘Research and Development’ , the query would look something like this

USE AdventureWorks2014
SELECT Name,GroupName FROM HumanResources.Department
WHERE GroupName = 'Research and Development'

This query would filter the records that have the GroupName as ‘Research and Development’.

How to Filter records using WHERE clause in SQL Server ?
%d bloggers like this: