I had a requirement to return the thread with the most replies in each forum at JavaRanch‘s Coderanch forums. In Postgresql 8.4, this would be very easy – just use the window functions. Unfortunately, we aren’t on Postgresql 8.4 yet. The other common pattern is something like This doesn’t work well for me either because [...]
↧