I have a table which has columns version(timestamp), Id , Name , Date etc.
I want to get the row with the latest timestamp which I can get easily using a where condition as below:
where version = (SELECT MAX(version)
FROM table t2
WHERE t2.Id = t1.Id)
But I am stuck if 2 rows have the same timestamp and different Date column values, then I need to select the row with the latest Date column.
How do I get the latest row in that situation?