#2 How to construct a UNION

closed
nobody
None
5
2005-03-03
2005-02-21
dude
No

How does one construct the fiollowing:

SELECT au_lname FROM authors
UNION ALL
SELECT lname FROM Employee

Thanks..

Discussion

  • Alon Catz

    Alon Catz - 2005-02-21
    • status: open --> closed
     
  • Alon Catz

    Alon Catz - 2005-02-21
    • status: closed --> open
     
  • Alon Catz

    Alon Catz - 2005-02-21

    Logged In: YES
    user_id=701386

    At this point there is no support for UNIONs. It will be inluded
    in the next release.
    In the mean time, you can construct two separate
    SelectQueries render them and put the UNION clause between
    them manually.

     
  • Alon Catz

    Alon Catz - 2005-02-28

    Logged In: YES
    user_id=701386

    Version 0.5 supports UNIONs

    Example:

    SqlUnion union = new SqlUnion();
    SelectQuery query = new SelectQuery();
    ...
    union.Add(query);

    query = new SelectQuery();
    ...
    union.Add(query, DistinctModifier.All);

    query = new SelectQuery();
    ...
    union.Add(query, DistinctModifier.Distinct);

    string sql = Renderer.RenderUnion(union);

     
  • Alon Catz

    Alon Catz - 2005-03-03
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks