Search code examples
sqloracleoracle11g

SQL query to find greatest in columns and rows


How does one in oracle find the greatest of three columns in say 10 rows?

The requirement is I have three dates column and I have need to find greatest of three columns in 10 rows. I know greatest will find in one row.

How?


Solution

  • How about

    select max(greatest(date1, date2, date3, date4)) from my_table;