with rws as (
select o.*, row_number () over (
partition by t_gruppe
order by t_gruppe
) rn
from qztuser o
)
select q_user, t_gruppe, lzudat from rws
where lzudat is null and rn <= 3
order by t_gruppe;
REF: https://blogs.oracle.com/sql/post/how-to-select-the-top-n-rows-per-group-with-sql-in-oracle-database
No comments:
Post a Comment