Hello everybody, I'm newbie in oracle and still getting started with it.. I need ur help for answering my curiosity.. How can I CREATE FUNCTION to FIND MAXIMUM VALUE FROM SOME NUMBERS I ENTERED AS PARAMETER? WITHOUT USING TABLE? E.G: I ENTERED AS PARAMETER (10,20,30) AND RESULT FROM THE FUNCTION CREATED IS "30"? HOW CAN I? Please clarify my doubt. Many Thanks.

Your requirement is not clear. how many parameters you are entering. fixed or variable parameters ???

You requirement is not clear.. Anyway, if you want to get the greated value of multiple parameter you can use GREATEST function. Code (SQL): SQL> SELECT greatest(10,20,30) FROM dual; GREATEST(10,20,30) ------------------ 30 SQL>

Thanks for your response kiran.marla. I entered multiple parameters and use variable parameters. BTW, I've got the answer from rajavu. Use GREATEST. Many Thanks, Regards.

Hey all - I know this question has been answered using the GREATEST function, but just in case someone drops in to look...searching for something similar... Some times it can in addition be wishful to find a maximum value, and then compare another value against it. One way this can be done is to use a query similar to this: Code (SQL): SELECT x.val ,MAX(x.val) OVER (PARTITION BY 1) max_val ,ROUND(((x.val * 100) / MAX(x.val) OVER (PARTITION BY 1)), 2) perc_of_max FROM ( SELECT 10 val FROM dual UNION ALL SELECT 20 val FROM dual UNION ALL SELECT 30 val FROM dual ) x ; -- It gives this result: VAL MAX_VAL PERC_OF_MAX 10 30 33.33 20 30 66.67 30 30 100 For anyone interested... ~ TJ