sql - 如何在 Oracle 中转置?
解决方案
您可以按如下方式使用条件聚合:
select subjid,
max(case when status = 'most recent dose' then date end) as most_recent_dose
max(case when status = 'second most recent dose' then date end) as second_most_recent_dose
max(case when status = 'dosing' then date end) as dosing
from your_table
group by subjid
推荐阅读
- python - 如何在 Kali 上整理和修复我的 Python 安装
- git - 如何将标签合并到分支中?
- python - Python 网站中使用的斐波那契代码中的多重赋值如何工作?
- python - 如何在python中重置for循环的索引号
- c# - 如何使用 OData EDM 配置强类型实体 ID(值对象)
- python - 时间戳未显示在 Python 的 yfinance 包中
- javascript - 将属性设置为子元素
- rest-assured - 如何使用 Rest Assured (Java) 将数组(带逗号的文本)作为 HTTP 参数发送
- python - 如何将我的 URL 列表作为参数传递给 requests.get() 函数?(python)
- electron - 如何在摩卡测试中添加“全局等待”