Is there a way in mysql to achieve
SELECT COUNT( SUM(field2) ) FROM TABLE WHERE field1='value' GROUP BY field2
Return one row with the total amount of the calculated field 2.
Field 1 && Field 2 is not unique.
If you need more information, just let me know.
Edit:
I did not think it was clear. I need COUNT from COUNT.
so that all the calculated values from field 2. this can be achieved by getting the number of rows, but I chose for this:
SELECT COUNT( first_count ) total_count FROM
( SELECT COUNT( field2 ) as first_count FROM TABLE
WHERE field1='value' GROUP BY field2 )t1
Or is there a faster request?
Greetings!
source
share