On 07 Aug 2001 07:24:59 -0400, Eldon Ziegler wrote:
> I have a table that includes a device ID (indexed) and the name of the
> device with multiple records ordered over time. How can I retrieve the last
> record for each device ID without retrieving them all to find the most
> recent name?
I believe your answer is in using GROUP BY clause together with MAX()
function. Other choise is to have separate tables for all device ID-s
and join them using MERGE table type.
--
For technical support contracts, goto https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Tonu Samuel <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Security Administrator
/_/ /_/\_, /___/\___\_\___/ Hong Kong, China
<___/ www.mysql.com
---------------------------------------------------------------------
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