Re: mySQL Question....
| From: | Jason Caldwell | Date: | Wed, 18 Apr 2001 06:01:26 +0000 |
| Subject: | Re: mySQL Question.... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-49125@lists.php.net to get a copy of this message | ||
Opps. I meant GROUP BY... and it looks like I don't need to include the
COUNT().
SELECT email_addr, x GROUP BY email_addr HAVING x = 1;
Is this the only way to display a listing without duplicates, or is there a
more efficient (faster) way? I don't want to DELETE the duplicates, just
don't want dups to show up in my SELECT queries.
Thanks.
Jason
""Jason Caldwell"" <jason@thinkingman.org> wrote in message
news:9bj9ld$pad$1@toye.p.sourceforge.net...
> if i perform a SELECT query (say) like the following:
>
> SELECT email_addr FROM myTable WHERE x = 1
>
> in this query i want to pull-out (or list) all email addresses where x
> equals 1, however, suppose i don't want any duplicate email addresses...
>
> would i use ORDER BY and COUNT(*) to get listing of non-duplicate email
> addresses, and just ignore the COUNT() ?
>
> Thanks.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>