adambedford Posted June 13, 2011 Share Posted June 13, 2011 hi, i have a database that looks something like this: +--------------+-------------------+-------------------+ | ce_id | ce_start_time | ce_cal | +--------------+-------------------+-------------------+ | 9 | 09:00 | 1105 | | 10 | 09:00 | 1105 | | 11 | 10:00 | 1105 | | 12 | 13:00 | 1201 | | 13 | 14:00 | 1201 | +--------------+-------------------+-------------------+ the ce_cal field refers to the year and period (11 = 2011 and 05 = period 5). i need to fetch the latest batch of records out of the table, ie those with the highest 'ce_cal' values. unfortunately, i don't know how to do this! any help would be appreciated, thanks! Quote Link to comment https://forums.phpfreaks.com/topic/239253-selecting-latest-group-of-records/ Share on other sites More sharing options...
gizmola Posted June 13, 2011 Share Posted June 13, 2011 ORDER BY ce_cal desc will return results from largest ce_cal to lowest. If there is something more specific you're after you'll have to provide further explanation. Quote Link to comment https://forums.phpfreaks.com/topic/239253-selecting-latest-group-of-records/#findComment-1229295 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.