I need to get the last record on the second table for the specific record. My query is working but getting the first record of the second table. I want to do this because I