|
-
Originally posted by anandkl
set serveroutput on
create or replace procedure rangs(range number) is
range1 number;
range2 number;
range3 number;
begin
select max(col1) into range2 from rang;
select min(col2) into range1 from rang;
if range >= range1 and range <= range2 then
select min(col2) into range3 from rang where col2 <= range;
end if;
dbms_output.put_line('least value in col2:'||range3);
end;
let me know if this what ur looking at
regards
anandkl
Thank you very much. I know this can be done in PL/SQL. Actually I am looking for a single select statement. Can it be done?
Thanks In Advance.
Nagesh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|