I'm not a SQL expert and although this seemed like a simple enough query, I can't figure out how to do it...I've tried everything I know, have googled and tried things I didn't know but I just can't get a clean output. I'm sure this must have been asked before but I have failed to find the answer. Hoping someone can put me out of my mental misery...
TABLE 1
TABLE 2
What I need to is:
for each acc_nbr/sip_nbr pair in TABLE 1, get the latest sell_dt and using the sell_dt, get the price of the sip_nbr on that date from table 2
So for example, for yyGG10234/xxFF10234, the output should be