WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

SQL WHERE Clause


The WHERE statement is utilized to extricate just those records that satisfy a predefined criterion.


The SQL WHERE Clause 

WHERE is utilized to channel records

SQL WHERE Syntax

SELECT column_list
FROM table_name
WHERE condition;

Example Database

In this instructional exercise we will utilize the example database.

Below is a determination from the "Clients" table:

CustomerID FastName city Country
1

Jhon Dallas United States
2 Eva Houston United States
3 Maria Texas USA
4

Rajesh Delhi India
5 Stephine Lule UK



WHERE Clause Example

The following SQL proclamation chooses every one of the clients from the nation "India", in the "Clients" table:

Example

SELECT * FROM Customers
WHERE Country='India';

Text Fields

When working with content segments, encompass any content that shows up in the announcement with single quotes (').:

Example

SELECT * FROM Customers
WHERE Country=India;

Operators in The WHERE Clause

Comparison Operators and Logical Operators are utilized in the WHERE provision to channel the information to be selected.

The following administrators can be utilized in the WHERE clause:

Operator Description
= Equal
<> Not rise to. Note: !=
> Greater than
< Less than
>= Greater than or equal
<= Less than or equal
BETWEEN Between a comprehensive range
LIKE Search for a pattern
IN To indicate different conceivable qualities for a column