Sap Hana Operator
Sap Hana Operator
SAP HANA Operator can be used for calculation, value comparison or to assign value. SAP HANA Contain below operators-
Arithmetic Operator
String Operators
Comparison Operator
Logical Operator
Set Operator
Arithmetic Operator
Addition (+)
Subtraction (-)
Multiplication ( * )
Division ( / )
String Operator
A String Operator is a concatenation operator which combines two items such as strings, expressions or constants into one.
Comparison Operator
Comparison operator is used to compare two operand. Below are list of Comparison Operator-
Equal to ( = )
Greater Than ( > )
Less Than ( < )
Greater than or equal to ( > = )
Less than or equal to ( < = )
Not Equal (!= , <> )
Logical Operator
If both Condition1 AND Condition2 are true, then Combine condition is true else it will false.
If Condition1 OR Condition2 is true, then combine condition is true or false if both Conditions are false.
Set Operators
E.g.
I have two table (table1, table2) in which some values are common.
We use Set operator (Union, Union ALL, Intersect, except) for these two table in SQL as below –
Note: Here "DHK_SCHEMA" is a schema name, the user can change schema name in SQLaccordingly.
FROMDHK_SCHEMA.TABLE1
UNION
SELECT ELEMENT
FROMDHK_SCHEMA.TABLE2
) ORDER BY ELEMENT;
UNION SELECT * Combine
ALL Result of
FROM two or
more
( query
with all
SELECT ELEMENT duplicate.
FROMDHK_SCHEMA.TABLE1
UNION ALL
SELECT ELEMENT
FROMDHK_SCHEMA.TABLE2
ORDER BY ELEMENT;
INTERSECT SELECT * Combine
Result of
FROM two or
more
( query
with all
SELECT ELEMENT common
rows.
FROMDHK_SCHEMA.TABLE1
INTERSECT
SELECT ELEMENT
FROMDHK_SCHEMA.TABLE2
ORDER BY ELEMENT;
EXCEPT SELECT * Takes
output
FROM from first
query
( and
removes
SELECT ELEMENT row
selected
FROMDHK_SCHEMA.TABLE1 by the
second
EXCEPT query
SELECT ELEMENT
FROMDHK_SCHEMA.TABLE2
ORDER BY ELEMENT;