The table looks like this:
| colA | colB | colC | colD |some other cols
-----------------------------
|double|double| int | int |some other datatyps
I want to select the sum of each column and group by them. At the moment I have no conditions wich musst be true. So this is my query:
SELECT SUM(colA) as 'cola', SUM(colB)as 'colb', SUM(colC) as 'colc', SUM(colD) as 'cold', SUM(colA - colB)as 'sub'
FROM table_name
GROUP BY cola,colb,colc,cold,sub
And then it creates the error : Invalid use of group function
I red several posts about this error, but they all had an WHERE condition and a HAVING solved this problem, but I dont have a condition. Any Ideas what could cause this error message ?