I have a table like this
| Emplid | REQUEST_ID | Status | Status_Dttm |
|---|---|---|---|
| 1234 | 1 | Open | 02-Jun-2022 12.35.00.AM |
| 1231 | 5 | Draft | 02-Jun-2022 12.30.00.AM |
| 1234 | 1 | In Progress | 02-Jun-2022 12.47.00.AM |
How can I get request date as Min(Status Dttm) and current status as Max(Status Dttm) of every request
I tried using this
SELECT EMPLID,REQUEST_ID,MIN(Status_Dttm) AS "REQUEST DATE", (SELECT STATUS FROM STS_TBL WHERE MAX(Status_Dttm)) AS "CURRENT_STATUS" FROM STS_TBL;
getting error as "Group function is not allowed here"