I’m a little rushed for time so I know I could look for the answer myself but stackoverflow is faster! 🙂
I have a table with data let’s pretend it is product information. the table keeps track of when the product data is updated. If I run a query like
SELECT * FROM productChangeLog where change = 'price changed'
I get results like
id product date change
---------------------------------------------
236 product1 03/14/2011 'price changed'
241 product2 03/14/2011 'price changed'
242 product2 03/14/2011 'description changed'
512 product1 05/16/2011 'price changed'
517 product1 05/16/2011 'description changed'
what I want to do is select only the most recent ‘price change’ for each product. what do I need to add to my query so that i would only get row 241 and 512? the higher id is always the more recent change
thanks so much!
1 Answer