Как насчет этого:
select teamid,
sum(pointscored)
from (select teamid,
pointscored,
row_number() over (partition by teamid order by orderid) rn
from (select 1 teamid, 1 playerid, 0 orderid, 1 pointscored, 0 wassick from dual union all
select 1 teamid, 2 playerid, 1 orderid, 1 pointscored, 0 wassick from dual union all
select 1 teamid, 3 playerid, 2 orderid, 1 pointscored, 0 wassick from dual union all
select 1 teamid, 4 playerid, 3 orderid, 1 pointscored, 0 wassick from dual union all
select 1 teamid, 5 playerid, 4 orderid, 1 pointscored, 0 wassick from dual union all
select 1 teamid, 6 playerid, 5 orderid, 1 pointscored, 0 wassick from dual union all
select 1 teamid, 7 playerid, 6 orderid, 1 pointscored, 0 wassick from dual union all
select 1 teamid, 8 playerid, 7 orderid, 1 pointscored, 0 wassick from dual union all
select 1 teamid, 9 playerid, 8 orderid, 1 pointscored, 0 wassick from dual union all
select 1 teamid, 10 playerid, 9 orderid, 1 pointscored, 0 wassick from dual union all
select 1 teamid, 11 playerid, 10 orderid, 1 pointscored, 0 wassick from dual union all
select 1 teamid, 12 playerid, 11 orderid, 1 pointscored, 0 wassick from dual union all
select 1 teamid, 13 playerid, 12 orderid, 1 pointscored, 0 wassick from dual union all
select 1 teamid, 14 playerid, 13 orderid, 1 pointscored, 0 wassick from dual union all
select 1 teamid, 15 playerid, 14 orderid, 1 pointscored, 0 wassick from dual union all
select 2 teamid, 1 playerid, 0 orderid, 1 pointscored, 1 wassick from dual union all
select 2 teamid, 2 playerid, 1 orderid, 1 pointscored, 1 wassick from dual union all
select 2 teamid, 3 playerid, 2 orderid, 1 pointscored, 1 wassick from dual union all
select 2 teamid, 4 playerid, 3 orderid, 1 pointscored, 1 wassick from dual union all
select 2 teamid, 5 playerid, 4 orderid, 1 pointscored, 0 wassick from dual union all
select 2 teamid, 6 playerid, 5 orderid, 1 pointscored, 0 wassick from dual union all
select 2 teamid, 7 playerid, 6 orderid, 1 pointscored, 0 wassick from dual union all
select 2 teamid, 8 playerid, 7 orderid, 1 pointscored, 0 wassick from dual union all
select 2 teamid, 9 playerid, 8 orderid, 1 pointscored, 0 wassick from dual union all
select 2 teamid, 10 playerid, 9 orderid, 1 pointscored, 0 wassick from dual union all
select 2 teamid, 11 playerid, 10 orderid, 1 pointscored, 0 wassick from dual union all
select 2 teamid, 12 playerid, 11 orderid, 1 pointscored, 0 wassick from dual union all
select 2 teamid, 13 playerid, 12 orderid, 1 pointscored, 0 wassick from dual union all
select 2 teamid, 14 playerid, 13 orderid, 1 pointscored, 0 wassick from dual union all
select 2 teamid, 15 playerid, 14 orderid, 1 pointscored, 0 wassick from dual
) teams
where wassick = 0
)
where rn <= 11
group by teamid;
, который возвращает:
TEAMID SUM(POINTSCORED)
---------- ----------------
1 11
2 11
2 rows selected.