(select price.cost from price where
price.catalog_id1c = catalog.id1c
AND price.price_id1c = 'ee6d5270-6799-11da-a71d-001279911df8'
AND price.currency = 'руб'
) as cost
select sum(count) from residue where
residue.catalog_id1c = catalog.id1c
and
residue.sklad_id1c in(