#左连接LEFT JOIN 连接自己时的查询结果测试 #左连接LEFT JOIN 连接自己时的查询结果(都会出现两个重复字段),两个表都有as后只能查询相等条件merchant_shop_id非null的数据SELECT * FROM adm_keeshow_port as k LEFT JOIN adm_keeshow_port as p ON k.merchant_shop_id = p.merchant_shop_id WHERE p.`partner_id` = '25' #只有一个表用…
1.连接查询分为: inner join(自然连接,自连接) Left join(左连接)/Left outer join(左外连接):效果一样 Right join(右连接)/Right outer join(右外连接):效果一样 Full join(全连接)/Full outer join (全外连接) 2.大致语法如下: select a.*,b.* from table_3 as b FULL join table_2 as a on a.id=b.Mtype --左连接 select…