Re: Return 1 instance of each unique record?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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 column

The key is the GROUP BY part... check the manual for more of an explanation.

---John Holmes...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux