Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: how to write this sql?

Re: how to write this sql?

From: Mladen Gogala <gogala_at_sbcglobal.net>
Date: Mon, 19 Jul 2004 16:47:19 -0400
Message-ID: <20040719204719.GA27970@medo.noip.com>


I don't understand the tendency to write everything inline.

create or replace function num_upper_lim(x in number, ul in number)

          return integer deterministic
as
begin
if (abs(x) >= abs(ul) )

   then return(ul);
else return(x);
end if;
end;
/

This function will do precisely what the original poster wants.

select x,num_upper_lim(cnt) from
( select ....group by having...)

What is the fun of creating horrible, unintelligible SQL statements intended to do this little thing?

--

Mladen Gogala
Oracle DBA



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Mon Jul 19 2004 - 18:44:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US