Query: table1+table2+table3+table4

Discussion in 'MySQL' started by Atabek, May 15, 2011.

  1. #1
    Hello dear friends, this my first thread topic - i need yours help.

    I have 4 tables, e.g.:

    table1:
    id - key fieled
    name - varchar(10);
    id_t2 - table2.local_id
    id_t3 - table3.local_id
    id_t4 - table4.local_id

    table2:
    id - key fieled
    local_id - another local unique id
    smth - text;

    table3:
    id - key fieled
    local_id - another local unique id
    smth - text;

    table4:
    id - key fieled
    local_id - another local unique id
    smth - float field;

    ------------------------------------
    SELECT * from table1;

    id | name | id_t2 | id_t3 | id_t4

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

    Can i query to table1 and get such kind of results:

    id | name | table2.smth | table3.smth | table4.smth

    And update field table1.name?

    Thank You.
     
    Atabek, May 15, 2011 IP
  2. ntomsheck

    ntomsheck Peon

    Messages:
    87
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Look up JOINs, they should accomplish what you want
     
    ntomsheck, May 15, 2011 IP
  3. Atabek

    Atabek Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, i've found.
     
    Atabek, May 16, 2011 IP