c# - select rows whose sum greater than 0 using Linq -


i need do, example: select customers total sum of amount greater 0. tried below code , reference result trying fetch data. not getting proper result.

    var query = (from in salelist                      group a.cust_ledger_entry_no groups                      select groups.sum( s => s.amount) > 0).tolist(); 

i did above query.now need data satisfying above condition.please me.

you need where

var query = in salelist             group a.cust_ledger_entry_no g             g.sum( s => s.amount) > 0             select new { cust_ledger_entry_no = g.key, sumamount = g.sum( s => s.amount) }; 

i need result like, customers sum of amount greater 0 columns

if a customer , need select can use query:

var query = in salelist             group a.cust_ledger_entry_no g             g.sum( s => s.amount) > 0             customer in g  // flatten each group             select customer; 

Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -