Forum Stats

  • 3,768,646 Users
  • 2,252,827 Discussions
  • 7,874,668 Comments

Discussions

Greatest/ Least function

Dimpy
Dimpy Member Posts: 131 Red Ribbon

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;



Tagged:

Answers