I am trying to do the following: Let's say I have two tables: Journal and
Document. A journal can have zero-many documents associated with it, each
holding its own date/time field. Each journal also holds it own date
date/time field.
I am trying to write a query that will give me the TOP 10 journals where
there is at least 1 document and I want to order the output by the most
recent documents date/time field. Does this make sense?  LOL Here is an
example.

Given the following journals with related documents.....

Journal A
document1a - Jan 1, 2004
document2a - Jan 2, 2003
document1c - Dec 3, 2002
Journal B
document1b - Jan 3, 2001
document2b - Jan 4, 2000
document3b - Dec 2, 1999
Journal C
document1c - Dec 3, 2002
document2c - Jan 9, 2003
document2c - Jan 9, 2004

I would like to output to be like this....

Journal A - Jan 1, 2004
Journal B - Jan 3, 2001
Journal C - Jan 9, 2004

Anyone want to take a stab at it?

Here is the table setup..

Journal: journalId, title, createDate
Document: documentId, journalId, createDate

Thanks!

Mike
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to