I have two tables.
DOCUMENT and REVISION
I want to make a list of all documents and show the latest revision. It works fine to find MAX(revision.autonumber) but as soon as I do inner join I no longer get the correct result. I then get not only the MAX(revision.autonumber) but also earlier revisions.
Thanks for your help
I have tried the query below (and many other attempts)
select
document.ItemId,
document.Name,
Max(revision.autonumber)
from document
inner join
revision on document.ItemId = revision.itemid
group by
document.ItemId,
document.Name,
revision.doctitle