Where condition in SQL server

Where condition in SQL server

Where condition in SQL server- The SQL WHERE Clause The WHERE condition is used to filter records. The WHERE condition is used to extract only those records that fulfill a specified condition.

Syntax

SELECT column1, column2, column3, column4, ........
FROM table_name
WHERE condition;

Example

 

SELECT * FROM Employee
WHERE Name='Ram';
SELECT * FROM Employee
WHERE ID=1;

Operators in where condition in sql

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

 

2021-10-03