Hi all- I know this might seem simple, but for some reason I'm stumped. What I'm trying to do is get a count (from one table) of all the distinct values in a particular field. So for example, I'd be trying to find out how many unique email addresses are in the table.
Right now I'm doing this with PHP, and while it works, it's very slow and very clumsy. Here's the code: $result = mysql_query("select distinct email from subscribes"); $total = mysql_num_rows($result); So it has to retreive ALL the email addresses (in this case, about 800,000) and then count them. I want to be able to do something like: select count(distinct(email)) from subscribes; But that's not legal. Any thoughts/ideas you all could send in would be great. TIA! Chris Blessing [EMAIL PROTECTED] http://www.330i.net --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php