![]() |
![]() |
![]() |
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

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.
![]() |
![]() |
![]() |
Add comment