I'm trying to create a query that will select the first response in a table for any given request. The query I'm working with is:
This almost gets me there but the problem is if there are responses from more than one user in dbo_ArgusUser it selects both. What I want is only the first request.
Code:
SELECT request_id, response_from, MIN(response_date) AS MinResponse
FROM dbo_CPO_REQUEST_RESPONSE
WHERE response_from IN (SELECT username FROM dbo_ArgusUser WHERE dept_num IN ("20470","24000","45540","20465"))
GROUP BY request_id, response_from;
This almost gets me there but the problem is if there are responses from more than one user in dbo_ArgusUser it selects both. What I want is only the first request.