Hi everyone:
How do I get MySQL to summarize a query so that I receive only 1 instance
per similar record. I.E. if you have 10 records with name Smith and 5
records with Barney, etc, that it would return 2 records instead of 15.
Thanks!
Doug Coning
--
PHP Database Mailing List
How do I get MySQL to summarize a query so that I receive only 1 instance
per similar record. I.E. if you have 10 records with name Smith and 5
records with Barney, etc, that it would return 2 records instead of 15.
This should be on a MySQL list...
SELECT * FROM tbl WHERE ... GROUP BY
use GROUP BY field
Adam
On Fri, 6 Dec 2002, Doug Coning wrote:
Hi everyone:
How do I get MySQL to summarize a query so that I receive only 1 instance
per similar record. I.E. if you have 10 records with name Smith and 5
records with Barney, etc, that it would
Hi Doug,
How do I get MySQL to summarize a query so that I receive only 1 instance
per similar record. I.E. if you have 10 records with name Smith and 5
records with Barney, etc, that it would return 2 records instead of 15.
Try the MySQL DISTINCT feature.
=dn
--
PHP Database Mailing
: [EMAIL PROTECTED]
Sent: Friday, December 06, 2002 2:27 PM
Subject: Re: [PHP-DB] Return 1 instance of each unique record?
use GROUP BY field
Adam
On Fri, 6 Dec 2002, Doug Coning wrote:
Hi everyone:
How do I get MySQL to summarize a query so that I receive only 1
instance
per similar