SQL Inner join more than two tables

后端 未结 10 1175
感情败类
感情败类 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:07

    select WucsName as WUCS_Name,Year,Tot_Households,Tot_Households,Tot_Male_Farmers  from tbl_Gender
    INNER JOIN tblWUCS
    ON tbl_Gender.WUCS_id =tblWUCS .WucsId 
    INNER JOIN tblYear
    ON tbl_Gender.YearID=tblYear.yearID
    

    There are 3 Tables 1. tbl_Gender 2. tblWUCS 3. tblYear

提交回复
热议问题