get latest record for each ID

前端 未结 3 1536
甜味超标
甜味超标 2021-01-28 01:16

I would like to get the latest record for each server.

Here is some example data:

TimeGenerated        SourceName            ComputerName  Message
2014-1         


        
3条回答
  •  忘掉有多难
    2021-01-28 01:44

    I you only use a GROUP function, you can only display the columns which are part of that SELECT statement. If you need more data displayed, you need to work with a subquery. For example, if you want to "select *", you can't just use only a GROUP BY and no subquery. So, it depends what you want to display.

提交回复
热议问题