GregL83 Posted April 4, 2010 Share Posted April 4, 2010 Hey, I am trying to return the latest comments for a product. Each product could have multiple comments (rows), but I only want to return the latest comment (based off timestamp). Here is an example: prod_id | comment | time -------------|--------------|-------------- 1 | a | 1270018856 1 | b | 1270018801 2 | c | 1270018870 should return: prod_id | comment | time -------------|--------------|-------------- 1 | a | 1270018856 2 | c | 1270018870 any help???? thanks Quote Link to comment https://forums.phpfreaks.com/topic/197513-return-rows-with-max-lastest-update-time-for-a-product/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 4, 2010 Share Posted April 4, 2010 http://dev.mysql.com/doc/refman/5.1/en/example-maximum-column-group-row.html Quote Link to comment https://forums.phpfreaks.com/topic/197513-return-rows-with-max-lastest-update-time-for-a-product/#findComment-1036628 Share on other sites More sharing options...
GregL83 Posted April 4, 2010 Author Share Posted April 4, 2010 thanks, that helped a bunch! Quote Link to comment https://forums.phpfreaks.com/topic/197513-return-rows-with-max-lastest-update-time-for-a-product/#findComment-1036680 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.