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!

Greatest function

SainaaMay 6 2020 — edited May 7 2020

In case if two or more columns have equal value which one is chosen by greatest function?

SELECT a.*,

greatest(
    coalesce(addon, cms, upoint,card*8000),
    coalesce(cms, upoint,card*8000,addon),
    coalesce(upoint, card*8000,addon, cms),
    coalesce(card*8000, addon, cms,upoint)
  ) new_high_col
  from tserenlkham.data_shift_202001_a4 a

This post has been answered by mathguy on May 6 2020
Jump to Answer
Comments
Post Details
Added on May 6 2020
6 comments
424 views