/// <summary> /// Adds an INTERSECT operator to the query, which returns the intersection of 2 or more datasets /// </summary> /// <param name="table">The table to intersect</param> /// <returns>Returns a new instance of <see cref="SelectQueryBuilder"/> for the union query.</returns> public SelectQueryBuilder Intersect(string table) { var statement = new UnionStatement() { Type = UnionType.Intersect, Query = new SelectQueryBuilder(Context).From(table) }; Unions.Add(statement); return(statement.Query); }
/// <summary> /// Adds an INTERSECT operator to the query, which returns the intersection of 2 or more datasets /// </summary> /// <param name="query">The query to compound in this query statement</param> /// <returns>Returns this instance of <see cref="SelectQueryBuilder"/></returns> public SelectQueryBuilder Intersect(SelectQueryBuilder query) { var statement = new UnionStatement() { Type = UnionType.Intersect, Query = query }; Unions.Add(statement); return(this); }
/// <summary> /// Adds a UNION ALL clause to the query, which is used to combine the results of two or more /// SELECT statements and it does not remove duplicate rows between the various SELECT statements. /// </summary> /// <param name="query">The query to compound in this query statement</param> /// <returns>Returns this instance of <see cref="SelectQueryBuilder"/></returns> public SelectQueryBuilder UnionAll(SelectQueryBuilder query) { var statement = new UnionStatement() { Type = UnionType.UnionAll, Query = query }; Unions.Add(statement); return(this); }