Revert "Fix a SQL Error in getrank()"

This reverts commit 172a793cbb1e3781f7a9479a9bdf96f4139bb335.