TechArena Community

TechArena Community (http://forums.techarena.in/)
-   Software Development (http://forums.techarena.in/software-development/)
-   -   SQL error of aggregation (http://forums.techarena.in/software-development/1176874.htm)

Bull50 09-05-2009 11:30 AM

SQL error of aggregation
 
I am having the following query:

Code:

  SELECT 
  DATA.Account_Number AS Account_Number,
  DATA.Service AS Service
  DATA.Area AS Area,
  SUM (DATA.Quantity) AS Quantity,
  SUM (DATA.Amount) AS Amount
  FROM DATA
  GROUP BY DATA.Account_Number, DATA.Service, DATA.Area;

And then I get an error of aggregation. But how to achieve that?

My goal is to use the account numbers, service and same area and add the quantity and value of transactions, if I summarize.

opaper 09-05-2009 11:36 AM

Re: SQL error of aggregation
 
Your request is correct.

Can we have the DBMS used, a description of the table, possibly an extract of the data it contains, and the error message returned by the DBMS?

XSI 09-05-2009 11:37 AM

Re: SQL error of aggregation
 
It this possible:

Code:

  SELECT 
  DATA.Account_Number AS Account_Number,
  DATA.Service AS Service
  DATA.Area AS Area,
  SUM (DATA.Quantity) AS Quantity,
  SUM (DATA.Amount) AS Amount
  FROM DATA
  GROUP BY 1, 2, 3;



All times are GMT +5.5. The time now is 12:02 AM.