結果 : how to write rank function in sql