Hi,
A bit better would be:
my ($total) = $DB->table('Users')->select(['COUNT(DISTINCT(Email))'], {ReceiveMail=>'Yes'})->fetchrow_array;
but you are getting into non-portable SQL here. I don't believe this works in mysql 3.23 (or maybe 3.22). This will be a bit better as the database server is not fetching all the rows, but rather it's doing the counting.
Cheers,
Alex
--
Gossamer Threads Inc.
A bit better would be:
my ($total) = $DB->table('Users')->select(['COUNT(DISTINCT(Email))'], {ReceiveMail=>'Yes'})->fetchrow_array;
but you are getting into non-portable SQL here. I don't believe this works in mysql 3.23 (or maybe 3.22). This will be a bit better as the database server is not fetching all the rows, but rather it's doing the counting.
Cheers,
Alex
--
Gossamer Threads Inc.