SQL Server Performance, DBA Best Practices & Enterprise Data Solutions | MyTechMantra
Home » SQL Server Tutorial » SQL Server WHERE Clause T-SQL Tutorial with Examples

SQL Server WHERE Clause T-SQL Tutorial with Examples

Previous Page.. Begin Tutorial.. Next Page..

The WHERE Clause is used to fetch records from a table which meets the condition mentioned in the WHERE Clause.

This is Part 5 of 40 Part SQL Server T-SQL Tutorial. Click here to read it from the beginning….

WHERE Clause Syntax

Use <DatabaseName>
GO

SELECT column1, column2
	FROM schema.table
WHERE <condition>
GO

WHERE Clause is also used in UPDATE and DELETE Statement.

How to Use WHERE Clause in SELECT Statement to Retrieve Results which meets a condition

Use AdventureWorks2016
GO

SELECT 
	  FirstName
	, LastName 
FROM Person.Person
	WHERE LastName = 'Williams'
GO
How to Use WHERE Clause in SELECT Statement to Retrieve Results which meets a condition


In WHERE Clause supports below mentioned OPERATORS

Operator Description Operator Symbol
Equal =
Less Than
Greater Than
Less Than or Equal  <=
Greater Than or Equal >=
Not Equal <> 
To search for a specific pattern LIKE
To find data within a certain range BETWEEN
Used to Specify Multiple values IN

Click Next Page button to continue reading the topics and click on the Previous Page button to revisit the previous topic.

Previous Page.. Begin Tutorial.. Next Page..


Ashish Kumar Mehta

Ashish Kumar Mehta is a distinguished Database Architect, Manager, and Technical Author with over two decades of hands-on IT experience. A recognized expert in the SQL Server ecosystem, Ashish’s expertise spans the entire evolution of the platform—from SQL Server 2000 to the cutting-edge SQL Server 2025.

Throughout his career, Ashish has authored 500+ technical articles across leading technology portals, establishing himself as a global voice in Database Administration (DBA), performance tuning, and cloud-native database modernization. His deep technical mastery extends beyond on-premises environments into the cloud, with a specialized focus on Google Cloud (GCP), AWS, and PostgreSQL.

As a consultant and project lead, he has architected and delivered high-stakes database infrastructure, data warehousing, and global migration projects for industry giants, including Microsoft, Hewlett-Packard (HP), Cognizant, and Centrica PLC (UK) / British Gas.

Ashish holds a degree in Computer Science Engineering and maintains an elite tier of industry certifications, including MCITP (Database Administrator), MCDBA (SQL Server 2000), and MCTS. His unique "Mantra" approach to technical training and documentation continues to help thousands of DBAs worldwide navigate the complexities of modern database management.

Add comment

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.