Remove unnecessary INNER JOIN in sql to load a home server id

This commit is contained in:
AlexTheCoder 2017-03-01 02:43:44 -05:00 committed by cnr
parent 721dd5a29a
commit a069d7ab59

View File

@ -68,7 +68,7 @@ public class BonusRepository extends RepositoryBase
{ {
try (Connection connection = getConnection()) try (Connection connection = getConnection())
{ {
PreparedStatement s = connection.prepareStatement("SELECT cs.id FROM accountClan INNER JOIN clans ON clans.id = accountClan.clanId INNER JOIN clanServer AS cs ON clans.serverId = cs.id WHERE accountClan.accountId = " + accountId + ";"); PreparedStatement s = connection.prepareStatement("SELECT clans.serverId FROM accountClan INNER JOIN clans ON clans.id = accountClan.clanId WHERE accountClan.accountId = " + accountId + ";");
ResultSet rs = s.executeQuery(); ResultSet rs = s.executeQuery();
boolean hasRow = rs.next(); boolean hasRow = rs.next();
if (hasRow) if (hasRow)