Code Comments
Programming Forum and web based access to our favorite programming groups.Hi!!
I have this query in PHP:
$items2 = mysql_query("SELECT DISTINCT * FROM rev ORDER BY rev", $link);
I have three rows with the same data on it, and DISTINCT seems to be not wor
king, since I got all the rows, any ideas of what is going wrong?
--------------------------
MIGUEL GUIRAO AGUILERA
Logistica R8 - Telcel
Post Follow-up to this messageMiguel Antonio Guirao Aguilar wrote:
> Hi!!
>
> I have this query in PHP:
>
> $items2 = mysql_query("SELECT DISTINCT * FROM rev ORDER BY rev", $link);
>
> I have three rows with the same data on it, and DISTINCT seems to be not
> working, since I got all the rows, any ideas of what is going wrong?
Without knowing how many fields you have and what they are, no. But you
should realise that DISTINCT looks at _all_ selected fields in a record, so
if you have an auto_increment id field in amongst those selected, all the
records will be different.
David
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.