Una opción sería
SELECT id,
h,
n,
q
FROM (
SELECT id,
h,
n,
q,
row_number() over (partition by decile order by id, n) rn
FROM (
SELECT id,
h,
n,
q,
ntile(10) over (order by id, n) decile
FROM your_table
)
)
WHERE rn = 1
Probablemente haya un enfoque más eficiente usando PERCENTILE_DISC
o CUME_DIST
eso no está haciendo clic para mí en este momento. Pero esto debería funcionar.