Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Max from multiple columns

Orcl ApexSep 21 2019 — edited Sep 22 2019

Hi,

Sample data -

WITH t AS (

SELECT '01-JAN-19' as dates, 1 as first, 2 as second, 3 as third FROM DUAL UNION ALL

SELECT '02-JAN-19' as dates, 3 as first, 9 as second, 200 as third FROM DUAL UNION ALL

SELECT '03-JAN-19' as dates, 10 as first, 8 as second, 30 as third FROM DUAL

) SELECT * FROM t;

Requirement -

200 is maximum in these three columns so I want result as below, Date, Max Value and half of max value.

02-JAN-19, 100, 50

This post has been answered by Frank Kulash on Sep 21 2019
Jump to Answer
Comments
Post Details
Added on Sep 21 2019
4 comments
5,634 views