Joining of Three Tables
Monday December 15, 2003
In a recent forum posting, KimDim asks:
"I am trying to write an SQL query and need to join three tables - XXXXXX.DISC_HIST_P , XXXXXX.DISC_HIST, XXXXXX.USSL_ERATE_ACCUM. The problem I am having is when joining the combination of the first two tables to the third table. I am joining the combination table and third table on the shared USSL_FED_REQ_B field.
There is a one to many relationship between these two tables with the unique USSL_FED_REQ_B on the third table being identified by the combination of this field and a version number. When I do the join it must be on the USSL_FED_REQ_B that has the MAX version number. How can I do this within one SQL query?"
Can you help KimDim? Stop by our forum and post your reply.
"I am trying to write an SQL query and need to join three tables - XXXXXX.DISC_HIST_P , XXXXXX.DISC_HIST, XXXXXX.USSL_ERATE_ACCUM. The problem I am having is when joining the combination of the first two tables to the third table. I am joining the combination table and third table on the shared USSL_FED_REQ_B field.
There is a one to many relationship between these two tables with the unique USSL_FED_REQ_B on the third table being identified by the combination of this field and a version number. When I do the join it must be on the USSL_FED_REQ_B that has the MAX version number. How can I do this within one SQL query?"
Can you help KimDim? Stop by our forum and post your reply.


Comments
No comments yet. Leave a Comment