Como sugerencia para encontrar una solución para obtener las 3 primeras entradas por nombre de usuario,
es posible que necesites varios pasos sin utilizar la expresión de rango de ventana.
El código podría lucir así:
select appid, uname, count(*) as total
from zusage
group by appid, uname
order by appid, total descending
into corresponding fields of table @lt_all_usage.
select appid, max(total)
from @lt_all_usage.
group by appid
into table @lt_app_max
do 3 times.
select a~appid, a~uname, a~total
from @lt_all_usage as a
where
inner join @lt_app_max as b
on b~appid = a~appid and b~total = a~total
appending into table @lt_result
select a~appid, max(a~total)
from @lt_all_usage as a
inner join @lt_app_max as b
on a~appid = b~appid
and a~total < b~total
group by a~appid
into table @lt_app_max
endo.
sort lt_result by appid.
r