未经测试:
SELECt x.* FROM POSTS x JOIN (SELECt p.postid, SUM(v.vote) AS points FROM POSTS p JOIN VOTES v ON v.postid = p.postid GROUP BY p.postid) y ON y.postid = x.postidORDER BY (y.points - 1)/POW(((UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(x.timestamp))/3600)+2, 1.5) DESC LIMIT n



