Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Posts
    6

    Unanswered: query from 3 tables

    Hello,
    I'm having a problem with this:
    I have 3 tables.
    Two of them together have the same information as the third one, with the difference that they have different field names and the two first have a little bit more info about other things.
    I want to do a query and show the info that I want in one table, which must have common field names.

    For example, one table has this fields:
    -user
    -documents

    the other two tables have this info:
    Table 1:
    -user
    -id
    Table 2:
    -document
    -id

    (The users and documents from the first table are different as the other tables.)
    I want make a single table with the fields "user" and "documents" and have the users and documents of all 3 tables in there.
    How can I do this? Is this possible? Where could I get more information about this?
    Many thanks.

    Nacho

  2. #2
    Join Date
    Sep 2003
    Location
    London
    Posts
    56
    You need to read up on UNIONs

    SELECT blah FROM table 1
    UNION
    SELECT blah FROM table2

    Regards,

    Matt.

  3. #3
    Join Date
    Nov 2003
    Posts
    6
    I'll do it...thanx for your help!
    Greetings,

    Nacho

    PS: It works. Thanx again!
    Last edited by segovia6969; 11-05-03 at 15:14.

Posting Permissions

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