For a blog project, I want to order new posts by their rating and the datetime they were inserted.
But before ordering, I want to do some maths with those values to get get a good mix of popularity and currentness in the first posts showed. (like on reddits frontpage)
Can I do this with pure SQL? I dont think it is possible...
How would you approach this task?
Table: post columns: pid title content author date time last_edited category password
May be you need to create some expression and order by that - here I've tried to show how can it be: