Do you want to know about operators in SAP HANA? This is the right article to check various types of operators in SAP HANA Cloud.
Operators are badges or symbol that tell or gives instructions to the system to perform required functions as per the end users either mathematically or logically.
The calculation compares the values between two numbers or two pieces of data and assigns the values done through this function. Let’s get started to see more about operators in SAP HANA.
Types of Operators in SAP HANA Cloud
There are seven types of operators in SAP HANA to perform their own unique functions. Below are the types.
- Unary and binary operators
- Precedence operator
- Arithmetic operator
- String operator
- Logical operators
- Set operators
Unary and Binary Operators
Operator | Performing Functions | Illustration |
Unary | It is applicable to only one operand and a single value expression. | Plus operator(+) Minus operator(-) Negation operator(NOT) |
Binary | This applies to two operands or two value expressions with one operator | Additive operator(+,-) Multiplicative operator(*,/) Logical operator(AND, OR) |
Precedence Operators
In this, we can use more than one operator. This means multiple operators can use in this type. If the required operator is more than one, then SAP HANA analyze them based on operator precedence.
The values expressed with parentheses will be taken as a prior consideration. The different types of operators are described below. SAP HANA estimates operators with equal precedence from left to right.
Precedence | Operator | Operator Functions |
Highest | () | Parentheses |
+,- | Unary operator with positive and negative | |
*,/ | Multiplication, Division | |
+,- | Addition, subtraction | |
=,!=,<,>,<=,>=,like, Between || | Comparison and Concatenation | |
AND | Connection operator or conjunction | |
OR | Disjunction operator | |
Lowest | NOT | Logical negation |
Arithmetic Operators
Mathematical operations such as adding, subtracting, multiplying, and dividing numeric values can be done by this arithmetic operator in SAP HANA.
Operator | Symbol | Example |
Addition | + | 3+5 = 8 |
Subtraction | – | 6-3 = 3 |
Multiplication | * | 4*3 = 12 |
Division | / | 20/2 = 10 |
String Operator
In the SAP HANA, the string operator concatenates or combines two strings, expressions, or constants into one.
Operator | Description |
First name || Last name | We can concatenate two strings using ‘||’ but when any one of the strings is NULL, it returns NULL. |
Comparison Operators
Compares the number or thing or strings and performs the estimations. The comparison operator does not return the values as the arithmetic operator does in SAP HANA. It returns either 1 which indicates true or 0 for false.
Operator | Description | Examples |
= | Equal to | Select * From employee where age =25 |
> | Greater than | Select * From employees where age >25 |
< | Less than | Select * From employees where age <25 |
>= | Greater than or equal to | Select * From employees where age >=25 |
<= | Less than or equal to | Select * From employees where age <=25 |
!=,<> | Not equal to | Select * From employees where age !=25 Select * From employees where age <>25 |
Logical Operators
In this cloud version of SAP HANA, the logical operator is used to connect two or more values or expressions. We can also nullify them using the NOT operator.
Operator | Syntax | Definition |
AND | WHERE condition 1 AND condition 2 | In this, if both the conditions are true, then the combined conditions are also true and if one condition is false the output will be false. |
OR | WHERE condition 1 OR condition 2 | In OR condition, if any one condition is true, then the combined condition is true. If both conditions are false, then they return false and unknown else. |
NOT | WHERE NOT condition | If condition A is true then B is false, if A is false then B is true. Also, return UNKNOWN if the condition is UNKNOWN. |
SET Operators
The multiple queries are combined to return a single output by set operators. Below are the types of set operators in SAP HANA.
Operator | Returned output |
UNION | Combines the results of two or more select statements or query expressions. |
UNION ALL | Combines the results of two or more select statements or query expressions, even duplicate rows. |
INTERSECT | Combines the results of two or more select statements or query expressions, and returns all common rows. |
EXCEPT or MINUS | Takes the output from the first query and then removes the rows selected by the second query. |
Conclusion
In this tutorial, we have seen all the types of operators in SAP HANA. Also, we have seen descriptions, syntax, and its uses as well.
- Unary and Binary Operators
- Precedence Operators
- Arithmetic Operators
- String Operators
- Comparison Operators
- Logical Operators
- SET Operators
You may also read:
- SAP S/4HANA [Features, Advantages & Disadvantages]
- What is SAP BTP Cockpit?
- What is SAP HANA Cloud Data Lake

I am Chris Waldron, working as a Senior SAP HANA Consultant at Halliburton, Houston, Texas, United States. I have been working in SAP for more than 15 years, especially in SAP IT consulting and business consulting. I worked in various industries in Sales & Distribution, Customer Relationship Management, banking, Risk Management, etc. And I am an SAP Certified Development Specialist – ABAP for SAP HANA 2.0 and SAP HANA Modeling Certified consultant. Read more