Re: begginer question
| From: | Micah Stevens | Date: | Sat, 03 Sep 2005 18:44:01 +0000 |
| Subject: | Re: begginer question | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-40215@lists.php.net to get a copy of this message | ||
Select * from tablename group by customername order by serialnum DESC;
or
select distinct * from tablename order by serialnum DESC;
On Saturday 03 September 2005 12:34 pm, ziv gabel wrote:
> Hi everyone
> I just need something that I believe is very simple only I can't find an
> answer for it anywhere
>
> I have a database that each row has a machine, its serial, the customer and
> other details. The problem is that I have customers with more than one
> machine and I need to query for all the rows, but I don't want the rows
> that contain duplicate customers.
> The problem is that the only way for me to know the right row from let's
> say 3 rows that contain the same customer name is the serial number which
> needs to be the higher.
>
> So all I need a query to do that.
>
> Thanks in advanced
> Ziv