For ex, this one will work when I run it outside the func:
select a.gameid, sum(decode(a.nscores,'Perfect',100,'Excellent',95,'Good',80,'Poor',50) "scores"
from ...
group by...
Below won't work inside myfunc, it would give give the pl/sql statement ignored error pointing to SELECT so if I remove the a.gameid, it will compile with no errors(but my func won't work like my query above)
....
begin
select a.gameid, sum(decode(a.nscores,'Perfect',100,'Excellent',95,'Good',80,'Poor',50) "scores"
into x
from ....
where ...
return x
end myfunc;