MySQL Forums
Forum List  »  Newbie

question about DISTINCT
Posted by: shawn bright
Date: July 28, 2005 06:52AM

Hey there,
i have a table in MySQL that is updated about every 5 minutes with about a hundred new records. For an application i am building, i only need the info from the most recent entry for each specific unit. But, i need all of the info in that row.

i was going to use DISTINCT like this,

SELECT DISTINCT UnitNumber FROM table ORDER BY `autoinc` DESC

it gives me only the last record for each unit, but only returns the UnitNumber and i need all of the colums for each UnitNumber that it gives me.

Any idea how i could do this ?

thanks

Options: ReplyQuote


Subject
Written By
Posted
question about DISTINCT
July 28, 2005 06:52AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.