group by - I'm having problem with SUM() in MySQL -


i want fetch balanceamt of particular customer attended particular attender. criteria customer may buy more 1 items. each bought items has been recorded individually. @ cases 'attender' value null.

here's query:

select customer, attendedby, sum(balanceamt) billing group customer       having attendedby='attender' , customer='customername' 

my problem i'm getting value summed not attended 'attender' (i.e., including null value). me it..

thanx in advance..

i have feeling haven't gotten question right, write select statement this

select customer, sum(balanceamt)  billing  attendedby='attender' , customer='customername'  group customer   

i not sure assignedto is. if want sum on customer, assignedto be:

select customer, assignedto, sum(balanceamt)  billing  attendedby='attender' , customer='customername'  group customer, assignedto  

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -