Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    7

    Unanswered: help in joining tables

    I have 2 tables with the following data and fields (seperated by comma, for illustration purposes)

    Table 1:
    Doc_key1,User_id1
    64,41
    64,32

    Table 2:
    Doc_Key2,User_id2
    64,41
    60,41

    I want to return the following in a view:
    Doc_Key,User_id
    60,41
    64,32
    64,41

    Is this possible? How should it be done?
    Last edited by REB; 10-21-03 at 17:12.

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    select Doc_key1,User_id1
    from table1
    Union
    select Doc_key2,User_id2
    from table2

    blindman

  3. #3
    Join Date
    Oct 2003
    Posts
    7
    Fantastic! That should do it. Thanx.

    Originally posted by blindman
    select Doc_key1,User_id1
    from table1
    Union
    select Doc_key2,User_id2
    from table2

    blindman

Posting Permissions

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