SQL Comparison operator

In this chapter you will learn:
What is Comparison operator?
Types of Comparison operator
Examples of Comparison operator

What is Comparison operator?

The comparison operator is used to compare between two operands or expression except text, ntext or image. Comparison operator is mostly used with "where" clause to filter the records.

Types of Comparison operator

Comparision Operator Use
= Equals to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
<> != Not equal to
!< Not less than
!> Not greater than
Example

select * from Sales.SalesPersonQuotaHistory
where SalesQuota >= 100000;
Output
comparison operator exampleExample Description

In the above example, only such type of records has displayed which has the sales quotes value is more than 100000. You can see in the output, all the sales quota value is greater than 100000

SUMMARY

In this chapter we have learned comparison operator and it's type with examples. In the next chapter you will learn about logical operater 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.