Try the below query, Replace or Remove the item code as required.Select x."ItemCode", x."BatchID", x."BatchNumber", x."ExpDate", x."BinLocation", x."Qty"From(Select a."ItemCode", a."SnBMDAbs" as "BatchID", c."DistNumber" as "BatchNumber", c."ExpDate"...
Use the following Query.Select x."ItemCode", x."BatchID", x."BatchNumber", x."ExpDate", x."BinLocation", x."Qty"From(Select a."ItemCode", a."SnBMDAbs" as "BatchID", c."DistNumber" as "BatchNumber", c."ExpDate", b."BinCode" as "BinLocation",Sum(a."OnH...