I have two tables as tblDocument, tblDocVersions connected using primary key docid as follows:
tblDocument: docid | title
tblVersions: id | docid | verion | datecreated | status
tblVersions could have data as
id + docid + version
----+-------+--------+
1 | 1 | 1
----+-------+---------
2 | 1 | 2
----+-------+---------
3 | 1 | 3
----+-------+---------
4 | 2 | 1
----+-------+---------
5 | 3 | 1
----+-------+---------
6 | 3 | 2
----+-------+---------
Now I need to select each individual document with it latest version…
NOTE: I need to select the row from Versions that correcpond to the latest version number.
EDIT
Not sure but this will work for you