Introduction:

Here we will explain how to use AND operators in SQL Server or what is AND operators in SQL Server or how to filter record using AND operators  with where clause in SQL Server with Example.

Description:

The SQL AND operators are used to filter records based on multiple conditions. It is used with SQL statement WHERE clause. When we use AND to filter records two or more than two conditions all conditions should be True.

  • AND Syntax
SELECT column1, column2 
FROM table_name
WHERE condition1 AND condition2 

Example:

The Following SQL Statement selects all Records from Student Table.

select s.id,s.Name,s.Mobile,s.address1,s.age,f.amount from Student as s 
inner join Fee as f on s.id=f.StudentId

Result:

AND  operators in SQL Server

AND operators

The following SQL statement selects all students whose amount greater than 2000 and age Less Than 24.

select s.id,s.Name,s.Mobile,s.address1,s.age,f.amount from Student as s 
inner join Fee as f on s.id=f.StudentId where f.amount  > 2000 AND s.age < 24

Result:

AND  operators in SQL Server


I Hope this article will help to you.

comments


Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

You may also like