Special Case Grouping
The cats have decided the correct weight is the same as the 4th lightest cat. All cats shall have this weight. Except in a fit of jealous rage they decide to set the weight of the lightest three to 99.9
Print a list of cats, their weights and their imagined weight
Return: name, weight, imagined_weight
Order by: weight Show Table Schema
Correct output but can you use 'nth_value'?
nth_value() allows us to select the an arbitrary position in a subgroup next question
select name, weight, coalesce(nth_value(weight, 4) over (order by weight), 99.9) as imagined_weight from cats order by weight