3
Answers

Selecting last response for multiple postings.

Ask a question
Jon

Jon

17y
3.1k
1
I am trying to query a data base for among other things the last response to a posting.  The table containing the responses has response id's, post id's, responses, and date of response.  So I tried

I can get the last overall response with

SELECT response FROM responses WHERE response_ID in (SELECT top 1 response_id FROM  responses ORDER BY date_response DESC);


But I need the last response for each posting.  And I need it to be efficient because this is actually part of a larger statement.

Answers (3)