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.

 

Share your thought