別のオプションはrow_number()
です および条件付きウィンドウ関数:
select
name,
weight,
coalesce(
max(case when rn = 4 then weight end) over(order by rn),
99.9
) imagined_weight
from (select c.*, row_number() over(order by weight) rn from cats c) c