When I do this:
select sum(m.mot)
from rmtq mq
join rmo m on mq.id = m.id
where mq.another = 138;
return value = 2, which is correct. But when
The comments were right to question; lest anyone waste time on this you have to write the names of the parameters correctly, for example:
create or replace function get(p_another in number) return number
is ret number := 0;
begin
select sum(m.mot)
into ret
from rmtq mq
join rmo m on mq.id = m.id
where mq.another = p_another
return(ret);
end;