Forum Moderators: coopster
I just can't seem to find any reference of a query string, using two count statements. Any help would be appreciated.
I need to count the records that have a good email and at the same time count the same records that have a bad email.
Then display that result in table form, Grouped by com,net,org etc.
I can get good or bad emails based on the query below but not both at the same time.
SELECT `reg_em_report` . `em_assoc` , '
. ' `reg_em_report` . `em_code` , '
. ' COUNT( * ) COUNT_E '
. ' FROM `reg_em_report` `reg_em_report` '
. ' WHERE `reg_em_report`.`email`!= ""'
. ' GROUP BY `reg_em_report` . `em_assoc` , '
. ' `reg_em_report` . `em_code`
This returns:
GROUP .......................... GOOD
COM Emails ..................... 123456
ORG Emails ..................... 1234
This is what I want returned:
GROUP .......................... GOOD ................ BAD
COM Emails ..................... 123456 .............. 1234
ORG Emails ..................... 1234 .............. 123
Yes my example of the query was presented very basic hoping that the question would be understood.
That might be the way I have to go;)
The reason that I did not want to do a while mysql_fetch_array routine was that I am dealing with a record count > 15 million. The server load is getting topped out.
I am trying to make one native mysql call to the table in hopes that the load would not create a problem.