code: public SelectStatement mergeSubqueryStatement() {
          SelectStatement result = processLimitForSubquery();
          processItems(result);
          processOrderByItems(result);
          result.setParametersIndex(getParametersIndex());
          return result;
      }
docs: Merge subquery statement if contains.
  
  @return Select select statement