x*******i 发帖数: 1237 | 1 一直用sas sql,不太懂sql,这个partition by in sql code有点像sas group by?
有没有相对应的sas function? 谢谢谢谢
SELECT
MAX
(CASE WHEN ifm.flo_meas_id = '222301'
THEN DECODE(ifm.meas_value,
'In Process', '1 - In Process',
'Complete', '2 - Complete',
'Discontinued', '3 - Discontinued',
'Not Applicable', '4 - Not Applicable'
)
END) OVER (PARTITION BY pat_enc.inpatient_data_id ORDER BY ifm.recorded
_time desc)
AS Intake_Status
From .....;
Group by.......; |
|