1. We have moved to a new forum! There may be a few things not working properly so please let us know if you find a bug. Remember to use the bbCode [ sql ] tag for SQL statements.

How to use two joins in a single query?

Discussion in 'SQL - Questions and Answers' started by Vaibhav Pingl, Nov 26, 2006.

  1. Dialect: MS SQL
  2. ben Administrator

    Dialect: SQL 92
    SQL:

    SELECT * FROM table as t1
    JOIN table2 as t2 ON t2.t1_id = t1.id
    JOIN table3 as t3 ON t3.t1_id = t1.id


    In this example table2 and table 3 are children of table1 and both have a foreign key field named t1_id

Share This Page