Oracle GREATEST Function


/ Published in: SQL
Save to your folder(s)

A few examples of the GREATEST function


Copy this code and paste it in your HTML
  1. SELECT GREATEST(5, 18, 21, 3, 65) AS GREATEST_CHECK FROM dual;
  2.  
  3. SELECT GREATEST('France', 'England', 'Russia', 'Japan') AS GREATEST_CHECK FROM dual;
  4.  
  5. SELECT GREATEST('9', '12', '73', '15') AS GREATEST_CHECK FROM dual;
  6.  
  7. SELECT GREATEST('45', 'apple', 'banana', 100) AS GREATEST_CHECK FROM dual;
  8.  
  9. SELECT GREATEST(
  10. TO_DATE('25-MAR-2015'),
  11. TO_DATE('14-APR-2015'),
  12. TO_DATE('7-JAN-2015')) AS GREATEST_CHECK
  13. FROM dual;
  14.  
  15. SELECT GREATEST('France', 'England', NULL, 'Japan') AS GREATEST_CHECK FROM dual;
  16.  
  17. SELECT GREATEST('x', 'w', 'y', 'a', 'q', 'u', 'i', 'a', 'd', 's', 'g', 'k', 'e', 'w', 'i', 'p', 'a', 'z', 'b', 'c', 'm', 'w', 'r', 'y', 'n') ASGREATEST_CHECK
  18. FROM dual;

URL: http://www.databasestar.com/oracle-greatest/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.