Anyone wanna take a stab at how you'd write this in sequel (MSSQL) :
select MessageID, STUFF(
(
SELECT DISTINCT(', ' + t2.PatientName)
FROM XDS_DOCUMENTS t2
WHERE t1.MessageID=t2.MessageID
and t2.PatientName is not null
FOR XML PATH(''), TYPE
).value('.','varchar(max)')
,1,2, ''
) AS PTNAME
from XDS_DOCUMENTS t1 group by MessageID
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/6074bdf0-23a7-48da-8e30-dce8afcf0ae6n%40googlegroups.com.