hey frnds..
I have two table one is item master and another is stock detail..
i want to join the both table and sum the all qty of item.
means how i can use sum with join of two tables.....
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mukesh Kumar TiwariPosted Jul 8, 2014, 8:01 AM
Anupam SinghPosted Jul 2, 2014, 1:51 AM
Try this (not tested)
from stock in stocks
join master in _master on stock.materid equals _master.id
group stock by stock.materid
select new
{
Master_ID = master.id,
Stock_SUM = stocks.Sum(stock.qty)
}
orderby Stock_SUM descending