How Can We Help?
Introduction:
In this tutorial, we are going to explain how to use Oracle GREATEST function with basic syntax and many examples for better understanding.
GREATEST function returns the greatest value of given list of values.
Syntax:
GREATEST( value_1, value_2, value_3, ... value_n )
Name | Description |
Value_1 | The first value to evaluate whether it’s greatest or not. |
Value_2 | The second value to evaluate whether it’s greatest or not. |
Applies to::
Oracle 19c, Oracle 18c, Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i
Examples:
Let’s take some examples about Oracle GREATEST and how to use it:
SELECT GREATEST(6, 14, 20, 8, 3)
FROM DUAL;
SELECT GREATEST('6', '14', '20', '8', '3')
FROM DUAL;
SELECT GREATEST('Catty','Bolly', 'Fansy', 'Look')
FROM DUAL;
SELECT GREATEST('windaws', 'windews', 'windows')
FROM DUAL;
SELECT GREATEST('o', 'r', 's', 'k')
FROM DUAL;
Similar functions to Oracle GREATEST:
ROUND : rounds the column, expression, or value to n decimal places .
In this tutorial, you have learned how to use the GREATEST function to returns the greatest value of list of values passed.
Hopefully, it was clear and concise.