Sou leigo em banco dados,
SELECT SUM(E.TOT_VENDA) TOT_VENDA,
SUM(E.TOT_CONTABIL) TOT_CONTABIL,
SUM(E.TOT_CUSTO) TOT_CUSTO,
SUM(E.TOT_EST) TOT_EST
FROM
(select count(*) as itens_req
from
(
select
distinct a.cod_item, a.cod_fornecedor
from os_requisicoes a, os b, itens_custos ic
where a.cod_empresa = b.cod_empresa
and a.numero_os = b.numero_os
and b.status_os = 0
and a.cod_empresa = 4
and a.cod_empresa = ic.cod_empresa
and a.cod_item = ic.cod_item
and a.cod_fornecedor = ic.cod_fornecedor)) tot_req,
(SELECT PS2.preço_DE_VENDA_NO_CUSTO,
CASE
WHEN NVL(PS2.preço_DE_VENDA_NO_CUSTO, 'N') = 'S' THEN
SUM(ESTOQUE.QTDE * ITENS_CUSTOS.preço_VENDA)
ELSE
SUM(ESTOQUE.QTDE * ITENS_FORNECEDOR.preço_VENDA)
END TOT_VENDA,
SUM(ESTOQUE.QTDE * ITENS_CUSTOS.CUSTO_CONTABIL) AS TOT_CONTABIL,
SUM(ESTOQUE.QTDE * ITENS_CUSTOS.CUSTO_FORNECEDOR) AS TOT_CUSTO,
COUNT(*) AS TOT_EST
FROM ITENS_FORNECEDOR, ESTOQUE, ITENS_CUSTOS, PARM_SYS2 PS2
WHERE ITENS_FORNECEDOR.COD_ITEM = ITENS_CUSTOS.COD_ITEM
AND ITENS_FORNECEDOR.COD_FORNECEDOR = ITENS_CUSTOS.COD_FORNECEDOR
AND ESTOQUE.COD_ITEM = ITENS_CUSTOS.COD_ITEM
AND ESTOQUE.COD_FORNECEDOR = ITENS_CUSTOS.COD_FORNECEDOR
AND ESTOQUE.COD_EMPRESA = ITENS_CUSTOS.COD_EMPRESA
AND NVL(ITENS_FORNECEDOR.TIPO_ITEM, 'E') = 'E'
AND NVL(ESTOQUE.QTDE, 0) > 0
AND PS2.COD_EMPRESA = ESTOQUE.COD_EMPRESA
AND ESTOQUE.COD_EMPRESA IN (4)
GROUP BY PS2.preço_DE_VENDA_NO_CUSTO) E