• To combine all records from one or multiple resultsets use UNION [ALL]

    To combine all columns from one or multiple resultsets use JOIN (eg. INNER, LEFT/RIGHT OUTER, FULL OUTER)

    If you cannot JOIN two resultsets you want to combine (columns wise), use UNION with selecting NULL's in the first resultset for columns from second resultset (it will combine all columns and rows):

    SELECT r1.Col1, r1.Col2, ... r1.ColN, NULL, NULL, ... NULL

    FROM (SELECT Col1, Col2, ... ColN

    FROM ...whatever WHERE ...whatever) r1

    UNION ALL

    SELECT NULL, NULL, .... NULL, r2.Col1, r2.Col2, ... r2.ColN

    FROM (SELECT Col1, Col2, ... ColN

    FROM ...another whatever WHERE ...another whatever) r2

    ...If my question is not clear then please let me know.. I will give an example..

    If my answer is not clear (or irrelevant), please provide involved objects DDL, setup of sample data, clear output based on sample data provided and your query in a current state as per article from the link at the bottom of my signature 😉

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]