I have a table as below
--------Table 1----------
ID VERSION STATUS
001 1 1
001 1 2
002 1 3
002 2 4
002 2 3
So here I need to filter the ID's based on the max value of version and status. The expected result is below
--------Table 1----------
ID VERSION STATUS
001 1 2
002 2 4
I tried using the code
select *
from "table1"
where "VERSION" = (select max("VERSION") from "table1")
and "STATUS" = (select max("STATUS") from "table1")
But it is not working. Please help