- SAP HANA Tutorial
- SAP HANA - Home
- SAP HANA Introduction
- SAP HANA - Overview
- In-Memory Computing Engine
- SAP HANA - Studio
- Studio Administration View
- SAP HANA - System Monitor
- SAP HANA - Information Modeler
- SAP HANA - Core Architecture
- SAP HANA Modeling
- SAP HANA - Modeling
- SAP HANA - Data Warehouse
- SAP HANA - Tables
- SAP HANA - Packages
- SAP HANA - Attribute View
- SAP HANA - Analytic View
- SAP HANA - Calculation View
- SAP HANA - Analytic Privileges
- SAP HANA - Information Composer
- SAP HANA - Export and Import
- SAP HANA Reporting
- SAP HANA - Reporting View
- Bi 4.0 Connectivity to HANA Views
- SAP HANA - Crystal Reports
- SAP HANA - Excel Integration
- SAP HANA Security
- SAP HANA - Security Overview
- User Administration & Management
- SAP HANA - Authentications
- SAP HANA - Authorization methods
- SAP HANA - License Management
- SAP HANA - Auditing
- SAP HANA Data Replication
- SAP HANA - Data Replication Overview
- SAP HANA - ETL Based Replication
- SAP HANA - Log Based Replication
- SAP HANA - DXC Method
- SAP HANA - CTL Method
- SAP HANA - MDX Provider
- SAP HANA Monitoring
- SAP HANA - Monitoring and Alerting
- SAP HANA - Persistent Layer
- SAP HANA - Backup & Recovery
- SAP HANA - High Availability
- SAP HANA - Log Configuration
- SAP HANA SQL
- SAP HANA - SQL Overview
- SAP HANA - Data Types
- SAP HANA - SQL Operators
- SAP HANA - SQL Functions
- SAP HANA - SQL Expressions
- SAP HANA - SQL Stored Procedures
- SAP HANA - SQL Sequences
- SAP HANA - SQL Triggers
- SAP HANA - SQL Synonym
- SAP HANA - SQL Explain Plans
- SAP HANA - SQL Data Profiling
- SAP HANA - SQL Script
- SAP HANA Useful Resources
- SAP HANA - Questions and Answers
- SAP HANA - Quick Guide
- SAP HANA - Useful Resources
- SAP HANA - Discussion
SAP HANA - SQL Operators
An operator is a special character used primarily in SQL statement's with WHERE clause to perform operation, such as comparisons and arithmetic operations. They are used to pass conditions in a SQL query.
Operator types given below can be used in SQL statements in HANA −
- Arithmetic Operators
- Comparison/Relational Operators
- Logical Operators
- Set Operators
Arithmetic Operators
Arithmetic operators are used to perform simple calculation functions like addition, subtraction, multiplication, division and percentage.
Operator | Description |
---|---|
+ | Addition − Adds values on either side of the operator |
- | Subtraction − Subtracts right hand operand from left hand operand |
* | Multiplication − Multiplies values on either side of the operator |
/ | Division − Divides left hand operand by right hand operand |
% | Modulus − Divides left hand operand by right hand operand and returns remainder |
Comparison Operators
Comparison operators are used to compare the values in SQL statement.
Operator | Description |
---|---|
= | Checks if the values of two operands are equal or not, if yes then condition becomes true. |
!= | Checks if the values of two operands are equal or not, if values are not equal then condition becomes true. |
<> | Checks if the values of two operands are equal or not, if values are not equal then condition becomes true. |
> | Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true. |
< | Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true. |
>= | Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true. |
<= | Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true. |
!< | Checks if the value of left operand is not less than the value of right operand, if yes then condition becomes true. |
!> | Checks if the value of left operand is not greater than the value of right operand, if yes then condition becomes true. |
Logical operators
Logical operators are used to pass multiple conditions in SQL statement or are used to manipulate the results of conditions.
Operator | Description |
---|---|
ALL | The ALL Operator is used to compare a value to all values in another value set. |
AND | The AND operator allows the existence of multiple conditions in an SQL statement's WHERE clause. |
ANY | The ANY operator is used to compare a value to any applicable value in the list according to the condition. |
BETWEEN | The BETWEEN operator is used to search for values that are within a set of values, given the minimum value and the maximum value. |
EXISTS | The EXISTS operator is used to search for the presence of a row in a specified table that meets certain criteria. |
IN | The IN operator is used to compare a value to a list of literal values that have been specified. |
LIKE | The LIKE operator is used to compare a value to similar values using wildcard operators. |
NOT | The NOT operator reverses the meaning of the logical operator with which it is used. Eg − NOT EXISTS, NOT BETWEEN, NOT IN, etc. This is a negate operator. |
OR | The OR operator is used to compare multiple conditions in an SQL statement's WHERE clause. |
IS NULL | The NULL operator is used to compare a value with a NULL value. |
UNIQUE | The UNIQUE operator searches every row of a specified table for uniqueness (no duplicates). |
Set Operators
Set operators are used to combine results of two queries into a single result. Data type should be same for both the tables.
UNION − It combines the results of two or more Select statements. However it will eliminate duplicate rows.
UNION ALL − This operator is similar to Union but it also shows the duplicate rows.
INTERSECT − Intersect operation is used to combine the two SELECT statements, and it returns the records, which are common from both SELECT statements. In case of Intersect, the number of columns and datatype must be same in both the tables.
MINUS − Minus operation combines result of two SELECT statements and return only those results, which belong to first set of result and eliminate the rows in second statement from the output of first.