Comment Comment by withinboredom Sounds like a job for a windowing function. parent withinboredom 3 years ago