求一条SQL语句

卡哇伊 卡哇伊 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
首先有一个表里面每天有24条数据,就是每个整点一条 字段 ID date a b c


select id, date,max(MaxNum) MaxNum from(select CONVERT(varchar(13), date,120) date,id,
case when a<b then( case when b<c then c else b end) else(case when a<c then c else a end)
end as MaxNum from tb where )
as t3 group by id,date

语句取出 最大值,和那一天的值,但是具体到那个时间点就不知道了,怎么把具体的date 年月日时分拿到





就剩这么多分了
...全文
评论 11
收藏 已收藏
分享
返回顶部
卡哇伊
C# 111,128 成员 642,537 内容