MySQL Forums
Forum List  »  Newbie

Last or Max?
Posted by: Scott Holland
Date: July 26, 2011 07:51AM

I have an sql table that I count how many times an item appears. I would like it to show me the information associated with the newest record

So if I have:

ITEM PRICE DATE COLOR
pants 14.00 1/1/2011 blue
pants 14.25 1/2/2011 red
pants 15.00 1/3/2011 green
pants 14.75 1/4/2011 yellow
shoes 12.00 1/1/2011 white
shoes 12.25 1/2/2011 black
shirt 10.00 1/1/2011 orange
hat 14.00 1/1/2011 gray

I would like to see:


ITEM COUNT PRICE DATE COLOR
pants 4 14.75 1/4/2011 yellow
shoes 2 12.25 1/2/2011 black
shirt 1 10.00 1/1/2011 orange
hat 1 14.00 1/3/2011 gray


any help with direction would be greatly appreciated

Thanks,
Scott Holland

Options: ReplyQuote


Subject
Written By
Posted
Last or Max?
July 26, 2011 07:51AM
July 26, 2011 08:23AM
July 26, 2011 10:27PM


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.