Comparison Operators in Different Languages

NameComparison Operators
Python/Java/C/C#Javascript PHPSQLPowershell
Equal to=======-eq
Greater than>>>>-gt
Less than<<<<-lt
Greater than or Equal to>=>=>=>=-ge
Less than or Equal to<=<=<=<=-le
Not Equal to!=!=!=<>-ne
Identical===
Not Identical!==
Spaceship <=> 
Equal value and equal type ===
Not equal value or not equal type !==
Wildcard Comparison-like
Wildcard Comparison -notlike
Regular Expression Comparison-match
Regular Expression Comparison -notmatch
Replace Operator-replace
Containment operator -contains
Containment operator -notcontains
Like –contains, but with the operands reversed.(PowerShell 3.0) -in
Like –notcontains, but with the operands reversed.(PowerShell 3.0) -notin
Matches a value in a list IN()
Negates a conditionNOT
Within a range (inclusive) BETWEEN
NULL ValueIS NULL
Not-NULL ValueIS NOT NULL
Pattern matching with % and _ LIKE
Condition is met if subquery returns at least one row EXISTS

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a free website or blog at WordPress.com.

Up ↑

Design a site like this with WordPress.com
Get started