select a.*,b.检验结果,c.检验员 from
(SELECT T1. 采购单号,SUM(T3. 退货数量) [退货单数量总]
FROM A表 T1
LEFT J0IN B表 T2 ON T1. 采购单ID =T2. 采购单ID
LEFT J0IN C表 T3 ON T2. 入库单ID=T3.入库单ID THERE T1.采购单号=‘123'
GROUP BYT1.采购单号) a
left jion D表 b on a.采购单号 =b.检验单号
left jion E表 c on b.采购单ID =c.采购单ID