How to take max between two values in presto?

Member

by samara , in category: Third Party Scripts , 10 days ago

How to take max between two values in presto?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by giovanny.lueilwitz , 9 days ago

@samara 

You can take the maximum between two values in Presto using the GREATEST function. Here is an example:

1
SELECT GREATEST(10, 20) AS max_value;


This query will return the maximum value between 10 and 20, which is 20 in this case. You can replace 10 and 20 with any values you want to compare.