So here is a case where one of the column in a table has same values for multiple records but the Date
column has incremental values.
ID| PAY_CODE| RATE | Date
---------------------------------
1 | 1111 | 50 | 2017-01-01
2 | 1111 | 50 | 2017-02-01
3 | 1111 | 50 | 2017-03-11
4 | 1111 | 50 | 2017-05-21
How can I print only the latest record if the latest Date
entered is unknown?
Expected result:
ID| PAY_CODE| RATE | Date
---------------------------------
4 | 1111 | 50 | 2017-05-21
I need a SQL query which internally compares the Date
column and returns the highest value (Latest date in this case) - is this even possible?