Inheritance: DmlQueryStatement
 public virtual DmlSelectUnionStatement AddSelect(DmlSelectStatement select, bool unionAll)
 {
     selectStmtList.Add(select);
     if (!unionAll)
     {
         firstDistinctIndex = selectStmtList.Count - 1;
     }
     return this;
 }
Exemplo n.º 2
0
 public virtual DmlSelectUnionStatement AddSelect(DmlSelectStatement select, bool unionAll)
 {
     selectStmtList.Add(select);
     if (!unionAll)
     {
         firstDistinctIndex = selectStmtList.Count - 1;
     }
     return(this);
 }
Exemplo n.º 3
0
 public DmlSelectUnionStatement(DmlSelectStatement select)
 {
     selectStmtList = new List <DmlSelectStatement> {
         select
     };
 }
 public DmlSelectUnionStatement(DmlSelectStatement select)
 {
     selectStmtList = new List<DmlSelectStatement> {select};
 }
Exemplo n.º 5
0
 public virtual void Visit(DmlSelectStatement node)
 {
     VisitInternal(node.Group);
     VisitInternal(node.Having);
     VisitInternal(node.Limit);
     VisitInternal(node.Order);
     VisitInternal(node.SelectExprList);
     VisitInternal(node.Tables);
     VisitInternal(node.Where);
 }
Exemplo n.º 6
0
        /// <returns>argument itself if there is no union</returns>
        /// <exception cref="System.SqlSyntaxErrorException" />
        protected virtual DmlQueryStatement BuildUnionSelect(DmlSelectStatement select)
        {
            if (lexer.Token() != MySqlToken.KwUnion)
            {
                return select;
            }
            var union = new DmlSelectUnionStatement(select);
            for (; lexer.Token() == MySqlToken.KwUnion;)
            {
                lexer.NextToken();
                var isAll = false;
                switch (lexer.Token())
                {
                    case MySqlToken.KwAll:
                    {
                        isAll = true;
                        goto case MySqlToken.KwDistinct;
                    }

                    case MySqlToken.KwDistinct:
                    {
                        lexer.NextToken();
                        break;
                    }
                }
                select = SelectPrimary();
                union.AddSelect(select, isAll);
            }
            union.SetOrderBy(OrderBy()).SetLimit(Limit());
            return union;
        }
 public virtual void SetSelect(CreateTableSelectOption option, DmlSelectStatement select)
 {
     Select = new Pair<CreateTableSelectOption, DmlSelectStatement>(option, select);
 }