" A INNER JOIN ( SELECT MaterialCode, Kanban FROM Set_WMSKanBanSettle GROUP BY MaterialCode, Kanban HAVING COUNT(1) = 1 ) B ON A.Kanban = B.Kanban \n"+
" A INNER JOIN ( SELECT MaterialCode, Kanban FROM Set_WMSKanBanSettle GROUP BY MaterialCode, Kanban HAVING COUNT(1) = 1 ) B ON A.Kanban = B.Kanban \n"+
" AND A.MaterialCode = B.MaterialCode and A.WMSDeliveryNote is not null\n"+
" AND A.MaterialCode = B.MaterialCode \n"+
" LEFT JOIN Set_material t1 ON A.MaterialCode = t1.CustomerPartCode\n";
" LEFT JOIN Set_material t1 ON A.MaterialCode = t1.CustomerPartCode where A.WMSDeliveryNote is not null\n";