I have a table where month ID is of YYYYMM format such as 202207 for July 2022. The data type is a number.
I have a scenario where I want to query records from this table only with the most recent month. I'm not able to think of a solution without making the query too complex.
Select a, b
from data
where MonthID = max(MONTHID)
I know the above will not work but something similar perhaps? Any help is much appreciated.