时间:2021-07-01 10:21:17 帮助过:35人阅读
查询用户编号为1165且监测参数为(1,2,7,15,19,20)的数据:
select * from T_JianKangJC_JianCeSJ a where exists( select * from ( select JianCeCSID,max(JianCeSJ) as FTime from T_JianKangJC_JianCeSJ where YongHuID=‘1165‘ and JianCeCSID in (19,7,1,2,20,15) group by JianCeCSID ) x where x.JianCeCSID=a.JianCeCSID and a.JianCeSJ=x.FTime )
Sqlserver 查询一个字段里不同值的最新一条记录
标签:exists log img alt .com ecs color exist div