Okay, this is kind of complicated. I have a table with the following fields:
storyid
parentstoryid
[other stuff]
date
When a new story is added, it's parentstoryid and storyid are the same. If a new chapter is added to that story, the chapter's parentstoryid is the same number as the first chapter's. Now, here's my problem: I want to display some summary results from the first chapter's row, but based on the most recent chapter's date. To explain it visually:
Table info:
Story 1, Chapter 1:
storyid = 1
parentstoryid = 1
date = 05/01/02
Story 2, Chapter 1:
storyid = 2
parentstoryid = 2
date = 05/03/02
Story 1, Chapter 2:
storyid = 3
parentstoryid = 1
date = 05/05/02
[Other stories continuing on]
The results would display Story 1, Chapter 1's info, but it would be displayed before Story 2 because Story 1 had a Chapter 2 that was more recent than Story 2's. Make sense? How in the world do I do this SQL query? Is it even possible?