I came across an issue the other day at work that I thought I could not solve without PL/SQL. I researched because I wanted to get the result using a SQL statement. My issue was that I needed to find the max value between two columns in Oracle. Here is an example table
I wanted to find the greatest value between HIGH1 and HIGH2. I found this nice function.
SELECT GREATEST(HIGH1,HIGH2) FROM SPLICE_CONNECT WHERE FEAT_ID = 133977 AND FEAT1 = 2014 AND HIGH1 = 120;
This of course returns 120 since 120 > 86.
You can learn more about the greatest function here