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/ Least function

DimpyOct 25 2021

Hi Experts,
When i am using greatest function query is fetching smaller value and when i am using least function it fetches greater value. I am unable to understand the reason behind it.
Kindly help.

select LEAST(
(select value from scpomgr.zt_batch_Param where key_name ='MSEPER-MAX'),
(select MAX(DMDPOSTDATE) from SCPOMGR.SKUSAFETYSTOCKPARAM)-
to_date((SELECT value
FROM SCPOMGR.ZT_BATCH_PARAM
WHERE KEY_NAME='STARTDATE_LAG_CAPTURE' ),'DD-MON-YY')
) from dual;

image.pngimage.png

This post has been answered by User_H3J7U on Oct 25 2021
Jump to Answer
Comments
Post Details
Added on Oct 25 2021
2 comments
303 views