sql - 交易的最短日期
解决方案
您可以使用lag()
和过滤和聚合:
select account, min(tdate)
from (select t.*,
lag(type) over (partition by account order by tdate) as prev_type
from t
) t
where prev_type = 'Withdrawal'
group by account;
推荐阅读
- c# - 使用 CefSharp 从 Web 浏览器/网页截屏时异步等待同步事件/操作
- r - 类别内的条件计数
- java - 如何使用浏览器访问安全的 Spring API?
- c# - C#:运行N个任务的正确方法,等待第一次成功(检查它),停止其他任务并尽快将结果返回给用户
- excel - 365 office运行时1004调试
- c# - 每两次调用一次事件点击
- reactjs - React - 使用新方法时如何更改以旧方式编写的代码?
- pdf - Mendeley 以前的 pdf 视图功能?
- linux - 期望 ssh reg_ex 用于远程提示
- apache-kafka - 将 Kafka 拆分为单独的主题或单个主题/多个分区