SQL Logical operators

In this chapter you will learn:
What is Logical operators?
Types of Logical operators
Example of Logical operators

What is Logical operators?

There are so many logical operators in which every operator has different types of work. Here all logical operators described with some examples.

Types of Logical operators

Logical Operator
ALL
AND
ANY
BETWEEN
EXISTS
IN
LIKE
NOT
OR
SOME
ISNULL
UNIQUE
Example
select * from Sales.Customer
where CustomerType='s'
and (TerritoryId='4' or TerritoryId='5');
Output
logical operator example

Example Description

In the above example only those data retrieve from database which customer type is s and TerritoryId is 4 or 5. You can see the output in the figure.

SUMMARY

Here you have learned the logical operators and its type. An example of and, or logical operator is also given herewith output. In the next chapter you will learn about String concatenation operator and its type.

More Articles

 

Share your thought



PLEASE DISABLE ADBLOCKER AND SUPPORT US!

Please support us by enabling ads on this page. Refresh

YOU DON'T LIKE ADS, WE ALSO DON'T LIKE ADS!
 
But we have to show ads on our site to keep it free and updated. We have to pay huge server costs, domain costs, CDN Costs, Developer Costs, Electricity and Internet Bill. Your little contribution will encourage us to regularly update this site.