Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

TIMESTAMPTZ_CMP Function

TIMESTAMPTZ_CMP compares the value of two time stamp with time zone values and returns an integer. If the time stamps are identical, the function returns 0. If the first time stamp is greater alphabetically, the function returns 1. If the second time stamp is greater, the function returns –1.

Syntax

Copy
TIMESTAMPTZ_CMP(timestamptz1, timestamptz2)

Arguments

timestamp1

A TIMESTAMPTZ column or an expression that implicitly converts to a time stamp with time zone.

timestamp2

A TIMESTAMPTZ column or an expression that implicitly converts to a time stamp with time zone.

Return Type

INTEGER

On this page: