whoops forget the group by clause

select max(serial) from table
where clause
group by customer_id
order by...

bastien


From: ziv gabel <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] begginer question
Date: Sat, 03 Sep 2005 21:34:31 +0200

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

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


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

Reply via email to