How to take max between two values in presto?

Member

by samara , in category: Third Party Scripts , 5 months ago

How to take max between two values in presto?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by giovanny.lueilwitz , 5 months 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.

Related Threads:

How to take multiple values from one column in laravel?
How to get a max values in a query sparql?
How to get the min/max axis values in chart.js?
How to insert values from two tables into one in postgresql?
How to count unique values across two columns with certain types in postgresql?
How to join two table in symfony 5?