SQL Server Articles, SQL Server Tips, SQL Server Tutorials, SQL Server Tuning, SQL Server DBA, SQL Server Basics, Training, etc - MyTechMantra.com

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>

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

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

	, LastName 
FROM Person.Person
	WHERE LastName = 'Williams'
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 Mehta

Ashish Kumar Mehta is a database manager, trainer and technical author. He has more than a decade of IT experience in database administration, performance tuning, database development and technical training on Microsoft SQL Server from SQL Server 2000 to SQL Server 2014. Ashish has authored more than 325 technical articles on SQL Server across leading SQL Server technology portals. Over the last few years, he has also developed and delivered many successful projects in database infrastructure; data warehouse and business intelligence; database migration; and upgrade projects for companies such as Hewlett-Packard, Microsoft, Cognizant and Centrica PLC, UK. He holds an engineering degree in computer science and industry standard certifications from Microsoft including MCITP Database Administrator 2005/2008, MCDBA SQL Server 2000 and MCTS .NET Framework 2.0 Web Applications.

Add comment

Newsletter Signup! Join 15,000+ Professionals

Be Social! Like & Follow Us

Follow us

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