CREATE VIEW dbo.ApiProdInProgressView as
select op.ID, op.Nazwa, op.Kod, op.Technologia Techn, a.Quantity from dbo.ApiProdActivities a  
JOIN dbo.Operacje op ON a.OperationId = op.ID
where NextOperationRefId =0 and DeliveredToTheWarehouse=0 and Confirmed=1 and Quantity>0;