SQL – WHERE Clause
SQL WHERE Clause
SQL WHERE Clause is used to filter the recoreds on the basis of some condition.
This will fetch the results which will fullfill the condition specified.
SQL WHERE Syntax :
SELECT ColumnName1,ColumnName2,ColumnName3 FROM TableName WHERE Condition
Suppose The “Users” Table has following records :
Suppose we have to find those records which have ‘city’ value as “DELHI”
Example 1 – : The Following Example will fetch the results as
Example
SELECT * FROM Users WHERE city = “DELHI”;
The Above Query Will Fetch the results :
Example 2 – : Fetch The Results where user’s ID is ‘5’
Example
SELECT * FROM Users WHERE ID = “5”;
The Above Query Will Produce the result as :
Advertisements
Add Comment
📖 Read More
- 1. SQL - AND & OR
- 2. SQL ORDER BY
- 3. SQL - UPDATE
- 4. SQL - DELETE
- 5. SQL - Like
- 6. SQL In Operator
- 7. SQL Between
- 8. SQL Joins - INNER JOIN
- 9. SQL - LEFT JOIN
- 10. SQL - RIGHT JOIN