By | December 27, 2016

The SQL WHERE clause is used to fetch the records that fulfill a specified criterion/condition. The condition is specified by the WHERE clause


Consider a demo database Customer C.address
123eed3 Ramesh 987654321 #12,sec-4 mohali
aa22103 Tarun 987650000 #12,sec-14 b chd
00146hh Sia 812300912 #212,sec-86 panchukula
144dcv4 Rahul 700912366 #001,sec-19 c chd

Where clause example:

Result: C.address
00146hh Sia 812300912 #212,sec-86 panchukula

NOTE: SQL requires single quotes around text values, but numeric values are not enclosed in quotes.

Operators in The SQL WHERE Clause

Operator Description
= Equal
<> Not equal. Note: In some versions of SQL this operator may be written as !=
> Greater than
< Less than
>= Greater than or equal
<= Less than or equal
BETWEEN Between an inclusive range
LIKE Search for a pattern
IN To specify multiple possible values for a column

Leave a Reply

Your email address will not be published. Required fields are marked *