Re: mysql - SELECT DISTINCT problem
| From: | Mookstah | Date: | Sat, 08 May 2004 16:23:21 +0000 |
| Subject: | Re: mysql - SELECT DISTINCT problem | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-34309@lists.php.net to get a copy of this message | ||
<mariuspa@softhome.net> wrote in message
news:227796879.20040508173929@softhome.net...
> Hello,
>
> I use "SELECT DISTINCT tip, marca, model FROM modele" to select
> records without duplicates on the field "tip". This works ok, BUT if I
> use "SELECT DISTINCT tip, marca, model, id FROM..." (id is
> auto_increment and is the table's primary key) my query won't produce
> any result. ANyone has a clue? Thank you!
DISTINCT is ment for the total ressult, not for 1 field
maybe try "GROUP BY tip" for a better result.
>
> Best regards,
> Marius Panaitescu