Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

i need help with my queries of my inventory system

$
0
0

I want tosubtractthe number of entrieswiththe number of outputsof my products,but I have aproblem...the result isnot correct,when I dothe subtractionto getthe current amount ofmy products.

alsoI haveseveral inputs andoutputs of the sameproduct.

please I need your help

select e.codpro,(sum(e.cantidad)) as productentry from entradapro e
group by e.codpro

select s.codpro,(sum(s.cantidad)) as productoutput from salidapro s
group by s.codpro


select e.codpro,(sum(e.cantidad)- sum(s.cantidad))as total from entradapro e inner join salidapro s
on e.codpro = s.codpro
group by e.codpro

 

 

 

 

 

 

 

 

 


              

Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>