INTERVAL_ADD_UDF

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Definition

UDFs for the subtraction when one of its values is an interval and the other is a single access which is a reference to a column of type interval.

PUBLIC.INTERVAL_ADD_UDF
(INPUT_VALUE1 VARCHAR(), INPUT_PART1 VARCHAR(30), INPUT_VALUE2 VARCHAR(), INPUT_PART2 VARCHAR(30), OP CHAR, OUTPUT_PART VARCHAR())

Parameters

INPUT_VALUE1 VARCHAR

The value to be processed.

INPUT_PART1 VARCHAR

The time type, e.g. 'HOUR'.

INPUT_VALUE2 VARCHAR

The column reference name, e.g. 'INTERVAL_HOUR_TYPE'

INPUT_PART2 VARCHAR

The type of the column referenced.

OP CHAR

The sign that is being evaluated.

OUTPUT_PART VARCHAR

The output type.

Returns

A varchar resulting from the subtraction of the intervals.

Migration example

Input:

Output:

Last updated