MSSQL查询一个表格中某一个字段不同值的最新一条记录

select * from 表 a where exists(

select * from (

select 测站bai名du称zhi,max(时间) as FTime from 表 group by 测站名称) x

where x.测站名称=a.测站名称 and a.时间=x.FTime )



© 2016-2024 阿尔佛 aerfo.com | 豫ICP备17044542号 | 豫公网安备 41010602000172