I have a table with entries for different accounts and each account has different products listed in it with a date next to each entry. An example of the structure is below.
Account | Product | Holding | Date
A1 | Car1 | 2 | 2010-12-31
A1 | Car2 | 4 | 2010-12-31
A2 | Car3 | 2 | 2010-12-31
A2 | Car1 | 5 | 2010-12-31
A1 | Car1 | 7 | 2011-03-31
A1 | Car2 | 3 | 2011-03-31
A2 | Car3 | 1 | 2011-03-31
A2 | Car1 | 2 | 2011-03-31
I want to be able to inner join this table on itself where one date is 2010-12-31 and the other is 2011-03-31 then inner join on the accounts and product so i can get a change in holdings. Is this possible and how would I do it? I have searched the internet and a lot of forumns and have come up with nothing.
Thanks in advance.