This script demonstrates the Greatest functions : greatest « Numeric Math Functions « Oracle PL / SQL






This script demonstrates the Greatest functions

  
SQL>
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
  2     v_char VARCHAR2(10);
  3     v_number NUMBER(10);
  4  BEGIN
  5
  6     v_char := GREATEST('A', 'B', 'C');
  7     v_number := GREATEST(1,2,3);
  8
  9     DBMS_OUTPUT.PUT_LINE('Greatest Character: '||v_char);
 10     DBMS_OUTPUT.PUT_LINE('Greatest Number: '||v_number);
 11
 12  END;
 13  /
Greatest Character: C
Greatest Number: 3

PL/SQL procedure successfully completed.

SQL>
SQL>

   
    
  








Related examples in the same category

1.GREATEST() returns the greatest of the list of expressions.
2.select greatest( 'A', 'a' )from dual;
3.select greatest( 'ONE', 1 )
4.select greatest( 1, 5, 10 )
5.GREATEST(12*6,148/2,73) LEAST(12*6,148/2,73)