Fix typo
Fix trending query for postgresql