小兔网

多表查询时,mysql语句为:

select a.*,b.* from 表A名 as a left join 表B名 as b on a.字段名=b.字段名;

当出现两个相同字段名字时,比如相同字段名为name,就可以a.name as aname,b,name as bname;

语句为:

select a.name as aname,b.name as bname from as a left join 表B名 as b on a.字段名=b.字段名;