Greatest Function in Netezza

user2740397 picture user2740397 · Sep 2, 2013 · Viewed 11.5k times · Source

Am trying to find the equivalent statement to below in Netezza

greatest(table1.column1, table2.column2, table3.column3)

also

least(table1.column1, table2.column2, table3.column3)

all the columns are dates

Any help is appreciated.

Answer

Alex picture Alex · Apr 8, 2017

In newer versions of Netezza, this will also work:

max(table1.column1, table2.column2, table3.column3)
min(table1.column1, table2.column2, table3.column3)