problem in query

  • i have two table like the following:

    name course

    ------- ---------

    mahmoud c++

    osam java

    and the second column as the following:

    name course1

    --------- ---------

    mahmoud db

    osama c#

    najeeb vb.net

    yahya xml

    please help me to make the following result

    name course course1

    --------- ---------- ------------

    mahmoud c++ null

    osama java null

    mahmoud null db

    osama null c#

    najeeb null vb.net

    yahya null xml

    thank you

  • Assuming the two tables are tableA and tableB you can do:

    SELECT name

    , course

    , NULL AS course1

    FROM tableA

    UNION ALL

    SELECT name

    , NULL AS course

    , course1

    FROM tableB

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply