Hi,
I have inherited an application that logs the results of certain daily commands that run on multiple hosts to an MS-SQL table. Now I've been asked to provide a view/query that displays the last log line per host to get an overview of the last results.
The table is similar to this:
------------------------------
|HOST |LAST_RUN |RESULT |
------------------------------
|SERVER1 |13-07-2009 |OK |
|SERVER2 |13-07-2009 |Failed |
|SERVER1 |12-07-2009 |OK |
|SERVER2 |12-07-2009 |OK |
|SERVER3 |11-07-2009 |OK |
------------------------------
In this case the query should output:
------------------------------
|HOST |LAST_RUN |RESULT |
------------------------------
|SERVER1 |13-07-2009 |OK |
|SERVER2 |12-07-2009 |Failed |
|SERVER3 |11-07-2009 |OK |
------------------------------
...as these are the last lines for each of the hosts.
I realise that it might be something simple I'm missing, but I just can't seem to get it right :-(
Thanks, Mark.