Skip to content
Advertisement

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?

Advertisement

Answer

How about

select max(greatest(date1, date2, date3, date4)) from my_table;
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement