"Alexey V. Litvinov" wrote:
>
> Hello JCampell,
>
> Friday, December 22, 2000, 11:25:51 AM, you wrote:
>
> RTFM about SELECT and about DISTINCT option
>
> J> I want to know if it is possible to build a MySQL query which will only
> J> return the unique values of a specific column. Ie if I had this table:
>
> J> id | name |date_______
> J> 1 | Jon | 2001-01-03
> J> 2 | Bob | 2001-01-04
> J> 3 | Jon | 2001-01-05
>
> J> Is there any SQL query that will only return 1 row for each value in the
> J> name column, or would I have to do that in PHP?
You will have to do that in PHP or use group by.
Distinct will only return rows that are unique for all columns
not just one as you wish.. If you want one day per unique
user you will have to tell the database which row you want for
Jon.
RTFM on GROUP BY :)
---------------------------------------------------------------------
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