I want to use an outer join from table A to a row on table B (which may not exist). I need to join on a date field in table B, which should be taken from the row which has the highest sequence number.
e.g.
Table B:
ID | A_DATE | SEQNO
1 01/01/1950 10
1 01/01/2000 5
So here I would need to join A and B for ID 1 using A.id = 1 and A.a_date = 01/01/1950 (the highest sequence number for ID 1).
I don't think this syntax is correct:
SELECT ...
FROM a, b
WHERE a.id (+) = b.id
AND ...
I'm lost - can anyone help?
Thanks!