当前位置:Gxlcms > 数据库问题 > Sql语句groupBY分组后取最新一条记录的SQL

Sql语句groupBY分组后取最新一条记录的SQL

时间:2021-07-01 10:21:17 帮助过:489人阅读

Message,EventTime from PT_ChildSysAlarms as a where EventTime = (select max(b.EventTime) from PT_ChildSysAlarms as b where a.PtName = b.PtName ) group by Message,EventTime order by EventTime desc

 

Sql语句groupBY分组后取最新一条记录的SQL

标签:desc   解决方案   语句   最新   event   group   class   color   eve   

人气教程排行