HOW TO USE WHERE CLAUSE IN SQL

WHERE IN SQL

WHERE

WHERE clause in SQL is a data manipulation language (DML) statement. WHERE clause is used in filter the records based on satisfying specific condition(s).

Syntax-

SELECT column_name1, column_name2, …column_nameN

FROM <table_name>

WHERE <condition>;

Example-

SELECT CustomerName FROM Customers

WHERE Country=‘Germany’;

Description-

The records having values from column_name1, column_name2, …column_nameN will be filtered and retrieved from table_name on meeting the condition provided with WHERE clause. Above example will provide the name of customers from column CustomerName where value in corresponding column matches to Germany.

Note-

Northwind sample database is used for example.


Leave a Reply

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