More Row Comparisons

Question:

Each cat would like to see the next heaviest cat's weight when grouped by breed. If there is no heavier cat print 'fattest cat'

Print a list of cats, their weights and either the next heaviest cat's weight or 'fattest cat'


Return: name, weight, breed, next_heaviest
Order by: weight

Show Table
Show Desired Output

Query Window:

Click me!

Show Hint
Show Answer

Your output: