How to change the multiple Row into 1 row
Hy Friends,
I have a question, how to change multiple rows into 1 row
.png)
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
Comments
you can pivot your table and concatenate the results or union join them
Wrap your SELECT in an Outer SELECT LIST(...inner select ...)
try:
SELECTLIST(DIAGNOSE) FROM (
SELECT MRDIA_.....->MRCID....
FROM ......
WHERE .....
ORDERBY ......
)Robert beat me to it, this was my suggestion too
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
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
.png)
SELECT LIST(Diagnose) FROM (SELECT TOP ALL MRDIA_ICDCode_DR->MRCID_Desc Diagnose FROM SQLUser.MR_Diagnos WHERE MRDIA_MRADM_ParRef=123456789 ORDER BY MRDIA_DiagnosisType_DR ASC)
Yes, It Works !!! Thank You Very Much @Vitaliy Serdtsev.png)
correct typing of latin characters is a very useful skill. .png)