是不是这个意思 With base as ( Select id, price, date lag(price)over(partition by id order by price) as prcie1, lag(date)over(partition by id order by date) as date1 From a ) Select id,max(case when price>prcie1 then datediff(date,date2) then 0 end) From base Group by id
点赞 1

相关推荐

Edgestr:没项目地址就干脆把那一栏删了呗
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务