How to filter to find most recent record
Hi. I'm new to the Oracle database.
I am working with a database and my question has to do with writing a query against three related tables.
There is a table called "Building". It holds building information (naturally). Then there is a table called "BuildingRank" which holds the possible ranking codes for the building (e.g., "AA", "A", "B", etc.). Then there is a table called "BuildingRankHistory" which relates a Building record to each Rank it's ever had. In BuildingRankHistory there is a ChangeDate field which holds the date that the building was assigned the associated rank. Don't ask me why it was designed this way. I just work here.
Anyway, my question actually stems from Warehouse Builder. I want to write a query that joins these tables with an output that lists each building and its current rank (i.e., the rank with the most recent change date).
Can anyone provide me with an appropriate SQL statement (including, if necessary, any "Oracle functions" with an associated explanation of how the function works)? I hope to use it as a guide in selecting the appropriate OWB operation. If you know what I should do in OWB, even better!
Thanks for reading my post!
Jason