Improved Watch List sorting

Christian Ullrich found a problem with the Watch List updating pages. Over the past few weeks, we’ve been working on fixing it. I’ve been coding. He’s been verifying. Today we fixed it. The changes should go into production soon (if they aren’t already).

The other thing he mentioned was sorting by last update. If there has been no updates in FreshPorts (i.e. the port has been added, and nothing further has been done), then the last update field would be NULL. That floats such values to the top. However, here’s a nifty trick, supplied to me by Dennis Bjorklund that puts non-null values first, and NULL values last:

ORDER BY foo IS NULL, foo DESC

foo IS NULL evaluates to FALSE when a value is present. FALSE < TRUE, and thus those values appear first in the result set. Nice. My thanks to both Christian and Dennis for taking the time to help out.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

Leave a Comment

Scroll to Top