inner join between 3 tables

≡放荡痞女 提交于 2019-12-02 13:32:13

you just try this

$sql = select * from third_table 
       inner join country on third_table.country_id = country.id
       inner join segment on third_table.segment_id = segment.id
$res = mysql_query($sql);

   'or'


   select * from TableA A 
   inner join TableB B on A.Column=B.Column 
   inner join TableC C on A.Column=C.Column
SELECT * 
FROM third_table t
INNER JOIN country c ON t.country_id = c.country_id
INNER JOIN segment s ON t.segment_id = s.segment_id

try this query.. this will help you to create list

select countrysegments.id as countrysegmentsID, country.country as countryName,
segment.country as segmentName
from countrysegments 
       inner join country on countrysegments.country_id  = country.id
       inner join segment on countrysegments.segment_id = segment.id
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!