SQL Where clause

Last revised On: 03/05/2016 Author Gaurav Shukla

SQL "Where" clause is used to filter the data from a database table object. This where is used with SELECT, INSERT, UPDATE, or DELETE statement. Below example will explain the use of Where clause in details.SQL Where clause syntax

SELECT column_name1,
FROM table_name
WHERE column_name1 operator_name value

In above example "operator_name" is the operator used for fetching the value;it could be any operator. The "value" is the value of columns on which records would be filtered. This value field must have the same data type as filtering column. So in this syntax;column_name1 and value must have same datatype so that SQL can compare it.


SELECT NationalIDNumber,
FROM HR.Employee
WHERE JobTitle='Design Engineer'


SQL Where Clause 

Where clause can be used with below Operators 

= Equal
<> Note equal. Note: Some of SQL version support this operator can be written as !=
> Greater than
< Less than
>= Greater than equal to
<= Less than equal to
BETWEEN Between an inclusive range
Like Search for a pattern
IN To specify multiple possible values for a column
AND To specify multiple AND condition
OR To specify multiple OR condition
Author: Gaurav Shukla
Published On: 06/08/2015
Last revised On: 03/05/2016

Share this chapter
comments powered by Disqus


Social Media