SQL Inner join more than two tables

后端 未结 10 1153
感情败类
感情败类 2020-11-29 23:21

I can currently query the join of two tables on the equality of a foreign/primary key in the following way.

 $result = mysql_query(\"SELECT * FROM `table1` 
         


        
10条回答
  •  一向
    一向 (楼主)
    2020-11-30 00:12

    A possible solution:

    SELECT Company.Company_Id,Company.Company_Name,
        Invoice_Details.Invoice_No, Product_Details.Price
      FROM Company inner join Invoice_Details
        ON Company.Company_Id=Invoice_Details.Company_Id
     INNER JOIN Product_Details
            ON Invoice_Details.Invoice_No= Product_Details.Invoice_No
     WHERE Price='60000';
    

    -- tets changes

提交回复
热议问题