Prior to understand Where clause, lets do a quick recap of SQL and then we will focus of WHERE clause.
What is SQL Queries ?
With SQL, we can query inside a database and have a result set returned.
A query like this:
SELECT FirstName, LastName FROM Person.Contact
this query will return result set like this:
Video Tutorial
What is Where Clause In SQL ?
How to filter rows in SQL Server ?
How to restrict rows in SQL Query ?
SQL WHERE Clause – The WHERE clause is used to specify a selection, this WHERE clause is used for criterion.
we can also say, WHERE clause is used in SQL Statements to limit the number of rows returned.
SELECT <<column list>> FROM table WHERE column operatorvalue
Example:
SELECT * FROM Persons WHERE City='Sandnes'
Operators, we always use operator with where clause to specify condition, these are the most commonly used operators.
