- 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 - Date and Time Operator
Query 1
presto:default> select date '2016-06-20' + interval '2' day as date_add;
Result
date_add ------------ 2016-06-22
The above output indicates two days are added from the specified date using an interval data type.
Query 2
presto:default> select time '12:30' + interval '1' hour as time_add;
Result
time_add -------------- 13:30:00.000
Here, one hour is added from the given time.
Query 3
presto:default> select timestamp '2016-06-21 12:32' + interval '2' year as timestamp_add;
Result
timestamp_add ------------------------- 2018-06-21 12:32:00.000
apache_presto_basic_sql_operations.htm
Advertisements
To Continue Learning Please Login
Login with Google