Jump to content

select multiple rows with the most recent column num


Recommended Posts

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!

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.