两个sql查询语句之间的左连接leftjoin
代码如下:
⼦查询内部也使⽤了左连接
select a.id, a.thumbNail,a.name,a.berPrice ,a.personName,a.portSendDate,b. (select od.id, ps.thumbNail,ps.name,od.berPrice ,od.personName,od.portSendDa der_detail od
LEFT der_logistics ol
ieveOrderLogisticId = ol.id
LEFT JOIN orders.product_snapshot pssql left join 多表连接
on od.productSnapShotId=ps.id
WHERE od.valid=true and ol.valid=true derId=? ) a
left join
(ackNumber ,od.id der_detail od LEFT der_logistics ol portSendOrderLogisticId=ol.id where od.valid=true and ol.v on a.id=b.id
INNER      等价于
你可以理解为    是  INNER JOIN  的缩写
JOIN  等价于    OUTER  JOIN
JOIN  等价于  OUTER  JOIN
逗号与inner等同,即只查询两表条件均满⾜的数据。
left join,左表数据多于右表
right join,与left join相反
full join,即是left join和right join的并集