Home » SQL & PL/SQL » SQL & PL/SQL » Finding the Minimum value
Finding the Minimum value [message #793] Mon, 04 March 2002 23:18 Go to next message
Elav
Messages: 7
Registered: October 2001
Junior Member
Hi there,

Is there any built-in functions available in Oracle to find the minimum value from the list.

(I.e. It should return 10 as the minimum value for this query MIN(12,10,11,15). I know MIN can take only one argument. IS there any other function available?)

I want to accomplish it without using IF..THEN condition. Can we do it without that.

Thanks in advance,

Rgds
Elav.
Re: Finding the Minimum value [message #796 is a reply to message #793] Tue, 05 March 2002 00:57 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
i am afraid there is no such built-in
Re: Finding the Minimum value [message #808 is a reply to message #793] Tue, 05 March 2002 07:04 Go to previous messageGo to next message
monir
Messages: 22
Registered: February 2002
Junior Member
USE DECODE WITH MIN TO SOLVE YOUR PROBLEM
GOOD LUCK
MONIR
Re: Finding the Minimum value [message #815 is a reply to message #808] Wed, 06 March 2002 00:53 Go to previous messageGo to next message
Elav
Messages: 7
Registered: October 2001
Junior Member
Hi Monir,

How DECODE will work? I tried my best but it doesn't. Will it work? Can u help me on this.

Rgds
Elav
Re: Finding the Minimum value [message #817 is a reply to message #793] Wed, 06 March 2002 01:42 Go to previous messageGo to next message
THA
Messages: 26
Registered: February 2002
Junior Member
Use least.

eg
select least(1,23,45) from dual;
will return 1

hope this will help you.
Re: Finding the Minimum value [message #825 is a reply to message #808] Wed, 06 March 2002 10:25 Go to previous message
monir
Messages: 22
Registered: February 2002
Junior Member
HI ELAV,
SORRY I DON'T UNDERSTAND YOUR QUESTION IN FIRST TIME
YOU CAN NOT DO IT WITH DECODE
AND I DON T KNOW ANY FUNCTION FOR THAT
SORRY
MONIR
Previous Topic: Formatting query for report
Next Topic: nvl
Goto Forum:
  


Current Time: Sat Apr 20 03:42:20 CDT 2024