1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| select p.Categorie,
p.NomImperial,
p.LongueurImp as Longueur,
p.Quantite,
ISNULL(sum(r.Quantite),0) as qteReserve,
(p.Quantite - (ISNULL(sum(r.Quantite),0))) as qteDisponible,
p.NomMetrique,
p.Endroit,
p.Specification
from PiecesInventaire p
left outer join Reservations r
on p.nopiece = r.nopiece and p.LongueurImp = r.longueurIMP
where p.categorie <> 8
and p.LongueurImp <> '0'
and p.Quantite <> 0
Group BY p.Categorie,
p.NomImperial,
p.LongueurImp,
p.Quantite,
p.NomMetrique,
p.Endroit,
p.Specification
order by p.NomImperial,
p.LongueurImp |
Partager