Hi,
i have two tables , the first one look like this
Col1 Col2 Col3
1 aaaa bbbb
2 yyyy zzzz
3 uuuu www
second table
FK PK RevNr
1 1 1
2 2 1
2 3 2
2 4 3
3 5 1
Col1 is the primary key in table one, and in table two the primaray key is PK and FK is the foreign key to table one.
I need a select wich return me all rows table one and from table two only the rows with the max(revision)
So the result should look like this:
Col1 Col2 Col3 FK PK RevNr
1 aaaa bbbb 1 1 1
2 yyyy zzzz 2 4 3 ( only the row with the greatest RevNr is returned )
3 uuuu www 3 5 1
Thanks for any suggestion