Oracle and Microsoft® SQL Server™ operators are nearly identical.
Arithmetic Operators
Operator | Oracle | SQL Server |
---|---|---|
Positive | + | + |
Negative | - | - |
Addition | + | + |
Subtraction | - | - |
Multiplication | * | * |
Division | / | / |
Character Operators
Operator | Oracle | SQL Server |
---|---|---|
Concatenation | || | + |
Comparison Operators
Operator | Oracle | SQL Server |
---|---|---|
Equal to | = | = |
Greater than | > | > |
Less than | < | < |
Greater than or equal to | >= | >= |
Less than or equal to | <= | <= |
Not equal to | !=, ^=, < > | !=, <> |
In any member in set | IN | IN |
Not in any member in set | NOT IN | NOT IN |
Any value in set | ANY, SOME | ANY, SOME |
All values in set | ALL | ALL |
Like pattern | LIKE | LIKE |
Not like pattern | NOT LIKE | NOT LIKE |
Value between | BETWEEN | BETWEEN |
Value not between | NOT BETWEEN | NOT BETWEEN |
Value exists | EXISTS | EXISTS |
Value does not exist | NOT EXISTS | NOT EXISTS |
Value {is | is not} NULL | IS NULL, IS NOT NULL | IS NULL, IS NOT NULL |
Logical Operators
Operator | Oracle | SQL Server |
---|---|---|
Negation | NOT | NOT |
Conjunction | AND | AND |
Disjunction | OR | OR |
Set Operators
Operator | Oracle | SQL Server |
---|---|---|
Return multiple result sets | UNION | UNION |
Return multiple result sets, including duplicates | UNION ALL | UNION ALL |
Return intersection of two result sets | INTERSECT | EXISTS |
Return difference between two results sets | MINUS | NOT EXISTS |
Other Operators
Operator | Oracle | SQL Server |
---|---|---|
Outer join | (+) | SQL-92 join syntax |
Determine direction of hierarchical query (used with CONNECT BY) | PRIOR | N/A |
Comparison Operators | Using EXISTS and NOT EXISTS to Find Intersection and Difference |
Migrating Join Clauses from Oracle to SQL Server |