Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

sql mysql Invalid use of group function

Avatar of teera
teera asked on
MySQL ServerSQL
4 Comments1 Solution508 ViewsLast Modified:
what wrong sql  statement
I add
  sale.grandtotal - Sum(sellnote.Paid) - Sum(sellnote.CreCard) -
  Sum(sellnote.PCheck) -   Sum(sellnote.Compens)

then error aucure        
Select sale.preselRef,
  sale.name,
  sale.saledate,
  sale.grandtotal,
  sale.secid,
  sale.invoicetype As typ,
  Sum(sellnote.Paid) As cash,
  Sum(sellnote.CreCard) As card,
  Sum(sellnote.PCheck) As cheque,
  Sum(sellnote.Compens) As compen,
  sale.grandtotal - Sum(sellnote.Paid) - Sum(sellnote.CreCard) -
  Sum(sellnote.PCheck) -   Sum(sellnote.Compens) As balanc
From sale,   sellnote
Where
 sale.preselRef = sellnote.Code and
  sale.grandtotal - Sum(sellnote.Paid) - Sum(sellnote.CreCard) -
  Sum(sellnote.PCheck) -   Sum(sellnote.Compens) 
Group By sellnote.Code               

[Err] 1111 - Invalid use of group function
ASKER CERTIFIED SOLUTION
Avatar of DonConsolio
DonConsolioFlag of Austria image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answers