Question Steven Henry Suhendra · Jun 5, 2024

How to change the multiple Row into 1 row

Hy Friends,

I have a question, how to change multiple rows  into 1 row

This data already in the right order, but  I need to change the Diagnose into 1 column with this order 1,2,3,4

So it should be Acute...,Fever..., Dyspepsia, Dengue fever

Does anyone could help me ?

Thank You

Best Regards,

Steven Henry

Product version: IRIS 2023.3

Comments

Heloisa Paiva · Jun 5, 2024

you can pivot your table and concatenate the results or union join them

0
Robert Cemper · Jun 5, 2024

Wrap your SELECT in an Outer  SELECT LIST(...inner select ...)
try:

SELECTLIST(DIAGNOSE) FROM (
 SELECT MRDIA_.....->MRCID....
 FROM ......
 WHERE .....
 ORDERBY ......
)
0
Chris Stewart  Jun 5, 2024 to Robert Cemper

Robert beat me to it, this was my suggestion too

0
Steven Henry Suhendra  Jun 5, 2024 to Chris Stewart

Hy @Chris Stewart it doesn't work my friend, it because of order by

I got an Info that Order by cannot used as Sub Query

0
Steven Henry Suhendra  Jun 5, 2024 to Robert Cemper

nice but it doesnt work, because of Order by,  I've try and it give an Error but if I comment Order By, it works, but not what I want

0
Vitaliy Serdtsev  Jun 6, 2024 to Steven Henry Suhendra
SELECT LIST(DiagnoseFROM
(SELECT TOP ALL MRDIA_ICDCode_DR->MRCID_Desc Diagnose
FROM SQLUser.MR_Diagnos
WHERE MRDIA_MRADM_ParRef=123456789
ORDER BY MRDIA_DiagnosisType_DR ASC)
0
Luc Morningstar  Jun 6, 2024 to Steven Henry Suhendra

correct typing of latin characters is a very useful skill. 

0