Implementing the Hacker News ranking algorithm in SQL
stackoverflow.com