Last active
November 9, 2017 16:51
-
-
Save mikaelweave/cdda19e16c7b77efbcbf to your computer and use it in GitHub Desktop.
Multiple Rows into One
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(select stuff( | |
( | |
select distinct ', ' + rtrim(pak_value) | |
from e_pstor | |
where e_pstor.ptype_id = '{55266899-ca35-4690-afaa-9af9b3b98ab2}' /* Code: Pharmacy Supplemental Clinical Rationale */ | |
and e_pstor.source_id = e_note.ct_id | |
and e_pstor.pak_value > '' | |
order by ', ' + rtrim(pak_value) | |
for xml path(''),type).value('.','varchar(max)'),1,1,'') | |
) AS Pharmacy_Supplemental_Clinical_Rationale_value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment