,
Share with your friends 

Advanced use of DECODE

7 ratings Views 208 
Author: Saurabh_OCA (Saurabh Gupta)  View Profile |  View other solutions by this author

Question / Problem


How can we get greater of two numbers using decode

Solution

Lets say two number A, B

SELECT DECODE(SIGN(A-B),1,A,-1,B,0,'EQUAL') FROM DUAL;


Applies to

Oracle 9i Sql

Rank It

Login to rank it

Report


Advertisement