You don't specify how your output should look like, so in these queries, I'm just guessing.This query joins all your specified tables, so you can pull out the fields you need (no summarizing on volume).select * from (select a.sohid from orderheader as a inner join orderdetail as b on b.sodid=a.sohid inner join productmaster as c on c.prdid=b.sodproductid and c.prdstateid<>'LG' and c.prdthickid='04' and c.prdgradeid='1c' and c.prdusrattribid='rq' and c.prdspeciesid='wok' inner join tagprodprofilemaster as d on d.tagproductid=b.sodproductid and d.tagstatus='inventory' and d.taglocation like 'MD%' where a.sohstatusid='open' group by a.sohid ) as a inner join orderheader as b on b.sohid=a.sohid inner join orderdetail as c on c.sohid=b.sohid inner join productmaster as d on d.prdid=c.sodproductid inner join tagprodprofilemaster as e on e.tagproductid=c.sodproductid inner join salesmanmaster as f on f.salid=b.sohsalesmanid inner join customermaster as g on g.cmid=b.sohcustid
Now this query shows same fields as in your queries, and summarizes volume per order, tag, position, location and product description.select b.sohid as 'order id' ,d.tagid as tag ,d.tagbinno as position ,d.taglocationid as location' ,c.prddescrip as 'product description' ,sum(d.tagvolume) as volume from (select a.sohid from orderheader as a inner join orderdetail as b on b.sodid=a.sohid inner join productmaster as c on c.prdid=b.sodproductid and c.prdstateid<>'LG' and c.prdthickid='04' and c.prdgradeid='1c' and c.prdusrattribid='rq' and c.prdspeciesid='wok' inner join tagprodprofilemaster as d on d.tagproductid=b.sodproductid and d.tagstatus='inventory' and d.taglocation like 'MD%' where a.sohstatusid='open' group by a.sohid ) as a inner join orderdetail as b on b.sodid=a.sohid inner join productmaster as c on c.prdid=b.sodproductid inner join tagprodprofilemaster as d on d.tagproductid=b.sodproductid group by b.sohid ,d.tagid ,d.tagbinno ,d.taglocationid ,c.prddescrip
I should mention that the above queries show all orderlines for orders, where a specific type of board is being purchased. If you want to show all orders for all customers, buying a specific type of board, use the queries below. First the one with all tables/fields.select * from (select a.sohcustid from orderheader as a inner join orderdetail as b on b.sodid=a.sohid inner join productmaster as c on c.prdid=b.sodproductid and c.prdstateid<>'LG' and c.prdthickid='04' and c.prdgradeid='1c' and c.prdusrattribid='rq' and c.prdspeciesid='wok' inner join tagprodprofilemaster as d on d.tagproductid=b.sodproductid and d.tagstatus='inventory' and d.taglocation like 'MD%' where a.sohstatusid='open' group by a.sohcustid ) as a inner join orderheader as b on b.sohcustid=a.sohcustid inner join orderdetail as c on c.sohid=b.sodid inner join productmaster as d on d.prdid=c.sodproductid inner join tagprodprofilemaster as e on e.tagproductid=c.sodproductid inner join salesmanmaster as f on f.salid=b.sohsalesmanid inner join customermaster as g on g.cmid=b.sohcustid
And the one with summarize.select b.sohid as 'order id' ,d.tagid as tag ,d.tagbinno as position ,d.taglocationid as location' ,c.prddescrip as 'product description' ,sum(d.tagvolume) as volume from (select a.sohcustid from orderheader as a inner join orderdetail as b on b.sodid=a.sohid inner join productmaster as c on c.prdid=b.sodproductid and c.prdstateid<>'LG' and c.prdthickid='04' and c.prdgradeid='1c' and c.prdusrattribid='rq' and c.prdspeciesid='wok' inner join tagprodprofilemaster as d on d.tagproductid=b.sodproductid and d.tagstatus='inventory' and d.taglocation like 'MD%' where a.sohstatusid='open' group by a.sohcustid ) as a inner join orderheader as b on b.sohcustid=a.sohcustid inner join orderdetail as c on c.sodid=b.sohid inner join productmaster as d on d.prdid=c.sodproductid inner join tagprodprofilemaster as e on e.tagproductid=c.sodproductid group by b.sohid ,d.tagid ,d.tagbinno ,d.taglocationid ,c.prddescrip
Hope this is somewhere near the result you are looking for.