Personal favorite linked list query
select distinct b.MaterialID,a.id,a.InNo,a.Title,a.FromType,a.FromBillID,d.orderNo ,a.Executor,h. Employee Name as ExecutorName,a.Processor,e. Employee Name as ProcessorName ,a.EnterDate,a.projectID,a.totalProduct ,case a.billStatus when '0' then 'document preparation' when '1' then 'execution' when '2' then 'statement' end as b illStatus ,a.DepId,f.CustName,b.ID as detailID,b.ProductNo,b.Specification,b.size ,b.unit,b.StorageID,c.StorageName,b.StorageDID,sd.ProductCount, c.StorageDName ,b.ProductCount,b.procedureNO,b.arts,b.RunCard, b.RuncardStatus from officedba.OutSourceInfo a left join officedba.OutSourceDetail b on a.InNo=b.InNo left join officedba.StorageDetailInfo c on c.ID=b.StorageDID and c.StorageNo=b.StorageID left join officedba.PurchaseOrder d on a.FromBillID=d.OrderNO left join officedba.EmployeeInfo e on e.ID=a.Processor left join officedba.ProviderInfo f on f.ID= a.DepId left join officedba.EmployeeInfo h on h.ID=a.Executor left join officedba.ProductInfo i on b.ProductNo=i.ProdNo left join MaterialDetailInfo j on j.MD03=i.ID left join officedba.CodeUnitType cu on cu.ID=b.Unit left join officedba.TechnicsArchives ta on ta.TechNo=b.arts left join officedba.RunCardDetail sd on sd.runcard=b.runcard and sd.ProcedureID=b.procedureNO where a.InNo='CKDBH2017040060'
I have written a blog about the efficiency of associative queries and subqueries before, showing my preference for associative queries. If the logic is clear enough, associative queries are a good choice. (The above is a sql statement for an associated query that I just wrote. I always feel that it is one or two meters long.)