Joining a table to the latest matching row of another table
Posted on 2004-09-30
I have two tables, SupportCall and CallHistory. The CallHistory table records the conversations that happen for a support call. I want a query that returns columns for a specified SupportCall, plus columns from the latest CallHistory row. CallHistory has an IDENTITY column HistoryID. How do I join the tables in a single query?
A column SupportCallID joins the tables. CallHistory has columns HistoryID, SupportCallID, ConversationDate, and ConversationDetails.