Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to filter to find most recent record

180634Mar 21 2002
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 27 2002
Added on Mar 21 2002
6 comments
736 views