Jump to content

select multiple rows with the most recent column num


peter.t

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...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.