- Apache Presto Tutorial
- Apache Presto - Home
- Apache Presto - Overview
- Apache Presto - Architecture
- Apache Presto - Installation
- Apache Presto - Configuration
- Apache Presto - Administration
- Apache Presto - SQL Operations
- Apache Presto - SQL Functions
- Apache Presto - MySQL Connector
- Apache Presto - JMX Connector
- Apache Presto - HIVE Connector
- Apache Presto - KAFKA Connector
- Apache Presto - JDBC Interface
- Custom Function Application
- Apache Presto Useful Resources
- Apache Presto - Quick Guide
- Apache Presto - Useful Resources
- Apache Presto - Discussion
Apache Presto - Logical Operator
Logical operators work on Boolean operands and produce Boolean results. Let’s take a few examples to see how logical operators work in Presto −
Query 1
select 3 < 2 and 4 > 1 as logical;
Result
logical --------- false
Here, 4 > 1 is false so “AND” operator returns the result as false.
Query 2
presto:default> select 3 < 2 or 4 > 1 as logical;
Result
logical --------- true (1 row)
Both conditions are true, hence the result is true.
Query 3
presto:default> select 3 not in (1,2) as not_operator;
Result
not_operator -------------- true (1 row)
Here, 3 value is not in the given set (1,2) hence it produces true result.
apache_presto_basic_sql_operations.htm
Advertisements