Skip to content

Commit e0593ac

Browse files
authored
Sort player baltop (#110)
2 parents d5da966 + 032a39e commit e0593ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/pro/cloudnode/smp/bankaccounts/commands/BaltopCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public BaltopPlayer(final @NotNull ResultSet rs) throws @NotNull SQLException {
8686
public static @NotNull BaltopPlayer @NotNull [] get(final int perPage, final int page) {
8787
final @NotNull List<@NotNull BaltopPlayer> entries = new ArrayList<>();
8888
try (final @NotNull Connection conn = BankAccounts.getInstance().getDb().getConnection();
89-
final @NotNull PreparedStatement stmt = conn.prepareStatement("SELECT `owner`, SUM(`balance`) AS `balance` FROM `bank_accounts` WHERE `balance` IS NOT NULL AND `balance` > 0 GROUP BY `owner` LIMIT ? OFFSET ?;")) {
89+
final @NotNull PreparedStatement stmt = conn.prepareStatement("SELECT `owner`, SUM(`balance`) AS `balance` FROM `bank_accounts` WHERE `balance` IS NOT NULL AND `balance` > 0 GROUP BY `owner` ORDER BY `balance` DESC LIMIT ? OFFSET ?;")) {
9090
stmt.setInt(1, perPage);
9191
stmt.setInt(2, (page - 1) * perPage);
9292
final @NotNull ResultSet rs = stmt.executeQuery();

0 commit comments

Comments
 (0)