private String getUpdatedTokenWithAlias(final String querySchema, final String tableName,
                                           final String fieldToken, final String aliasBefore,
                                           final String aliasAfter)
   {
      if (fieldToken.lastIndexOf(SQLFormatter.DOT) != -1)
      {
         final boolean isAggrToken = isAggregateToken(fieldToken);
         final String[] split = fieldToken.split("\\" + SQLFormatter.DOT);
         final String aggrToken;
         final String tableNameOfToken;
         final String fieldOfToken;
         final String schema;
         
         if (split.length == 3)
         {
            schema = querySchema;
         }
         else
         {
            schema = null;
         }
         boolean appendAggrTokenSpace = false;
         
         if (schema != null)
         {
            if (isAggrToken)
            {
               aggrToken = split[0].split("\\(")[0];
            }
            else
            {
               aggrToken = null;
            }
            tableNameOfToken = split[1];
            fieldOfToken = split[2];
         }
         else
         {
            if (isAggrToken)
            {
               final String[] functionSplit = split[0].split("\\(");
               aggrToken = functionSplit[0];
               tableNameOfToken = functionSplit[1];
               appendAggrTokenSpace = tableNameOfToken.startsWith(" ");
            }
            else
            {
               tableNameOfToken = split[0];
               aggrToken = null;
            }
            fieldOfToken = split[1];
         }
         if (isTableAliasMatches(aliasBefore, tableName, tableNameOfToken))
         {
            String updatedToken = "";
            if (aggrToken != null)
            {
               updatedToken = aggrToken + "(";
               if (appendAggrTokenSpace)
               {
                  updatedToken = updatedToken + " ";
               }
            }
            return updatedToken + aliasAfter + SQLFormatter.DOT + fieldOfToken;
         }
      }
      return null;
   }