【发布时间】:2021-01-06 09:49:19
【问题描述】:
【问题讨论】:
【问题讨论】:
您可以按如下方式使用条件聚合:
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
【讨论】: