select <查询的列名> from <表名>
inner join `<连接的表名称>`
on <第一张表的主键> = <第二张表的外键>
–没有先后顺序,下面依次类推,就接着inner join
–条件判断用where
例
select facilities.facilities_name,facilities.facilities_type from fitem
INNER JOIN `fitem`
ON fitem.villa_id = `villa_info`.villa_id
INNER JOIN `facilities`
ON facilities.facilities_id = `fitem`.facilities_id
where villa_info.villa_id=2
原创文章,作者:3628473679,如若转载,请注明出处:https://blog.ytso.com/277147.html