peter.t Posted September 21, 2009 Share Posted September 21, 2009 Here's the information in my table: id........name........issue_num........lead_story 1........Story1......1....................Yes 2........Story2......1....................No 3........Story3......1....................No 4........Story4......2....................Yes 5........Story5......2....................No 6........Story6......2....................No On my main page, I need two queries. One I've got figured out...that's calling the main story. Easy just query all the story id's in desc order and limit 1. The second query I haven't figured out yet. I need to call all the stories with the latest issue_num. This is for the sidebar of the page. So the main story (id1 or id4) is on the page and in the sidebar, are links to the other stories with the same issue num (if main is id1, then the titles to id2 and id3 would appear in the sidebar). Any chance this is a relatively simple query and I'm jsut missing something obvious? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/175048-select-multiple-rows-with-the-most-recent-column-num/ Share on other sites More sharing options...
peter.t Posted September 21, 2009 Author Share Posted September 21, 2009 I HATE it when I forget the obvious! I will be continuing to add to this table, so there will be stories for issue_num 5, 6, etc... Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/175048-select-multiple-rows-with-the-most-recent-column-num/#findComment-922566 Share on other sites More sharing options...
fenway Posted October 2, 2009 Share Posted October 2, 2009 If you want "latest", you'll need a timestamp somewhere. Quote Link to comment https://forums.phpfreaks.com/topic/175048-select-multiple-rows-with-the-most-recent-column-num/#findComment-929158 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.