sql查询一个表里面一个字段里面不同值的最近一条记录。急求!!

2025-03-23 07:55:41
推荐回答(1个)
回答1:

select * from 表 a where exists(
select * from (
select 测站名称,max(时间) as FTime from 表 group by 测站名称) x
where x.测站名称=a.测站名称 and a.时间=x.FTime )