I have two tables as below
Table A
Key Field1 Created_date
1234 a Jan-18
1234 b Feb-18
1234 c Mar-18
4567 d Mar-18
6789 e Apr-18
Table B
Key Posted_date
1234 Mar-18
4567 Apr-18
I want to join table A with B on the field Key and select records with max(A.created_date)
where A.created_date < B.posted_date
. The table B has around 300 million records. Could you please help me out.
Result
Key Field1 Created_date
1234 b Feb-18
4567 d Mar-18