Examining nearby rows

Question:

The cats would like to see the average of the weight of them, the cat just after them and the cat just before them. The first and last cats are content to have an average weight of consisting of 2 cats not 3.

Return: name, weight, average_weight

Order by: weight

Show Table
Show Desired Output

Query Window:

Click me!

Show Hint
Show Answer

Your output: