Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2002
    Posts
    4

    Unanswered: (seemingly) simple query question

    I have a table that looks like this:

    x t
    - ----
    1 0
    2 0
    1 1
    2 1
    3 1

    How do I query it to get this:

    t0 t1
    -- --
    1 1
    2 2
    NULL 3

    the formatting is messed up, but there are 2 fields: type0 with records 1,2,NULL and type1 with records 1,2,3

    Please help if you can, this is urgent.
    Thanks In Advance, Yury.

  2. #2
    Join Date
    Feb 2002
    Location
    Baltimore, MD
    Posts
    26
    I don't know which tables contain which data, but an outer join should do what you need.

    Code:
    SELECT   table1.type0
                  , table2.type1
    FROM      table1 RIGHT JOIN table2
                                         ON table1.field = table2.field
    Hope this helps.
    Rob Wilkerson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •