How to extract the latest row
- by Bob
Hi,
I have a table like this:
Table A
Date Time ID Ref
110217 91703 A001 A1100056
110217 91703 A001 A1100057
110217 91703 A001 A1100058
110217 91703 A001 A1100059
110217 132440 A001 A1100057
110217 132440 A001 A1100058
110217 132440 A001 A1100060
I wish to have the latest data only & the final result should look like this using SQL:
Date Time ID Ref
110217 132440 A001 A1100057
110217 132440 A001 A1100058
110217 132440 A001 A1100060
The database will self-update by itself at certain time. The problem is: I do not know the exact time, hence I do not know which record is the latest.
Thanks.