Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Concatenating Multiple rows of a column into 1 cell

$
0
0

Hello All,

          I'm sure this question has been asked multiple times, but i'm still not have a clear answer..

My Input

StateCity
ArizonaPhoenix
ArizonaMesa
ArizonaTempe
ArizonaScottsdale
ArizonaTuson
ArizonaBullHead City
ArizonaFlagStaff
ArizonaGlobe
WashingtonVancouver
WashingtonSeattle
WashingtonRichland
WashingtonOlmpia

 

My output

StateCity
ArizonaPhoenix,Mesa,Tempe,Scottsdale,Tuson,BullHead City,BullHead City,FlagStaff,Globe
WashingtonVancouver,Seattle,Richland,Olmpia

 

My question : (I have restrictions on accessing SQL in Hana)

Do we have anything in place to do this already for me in Hana (I not able to find one) ?

Does all SQL command work on SQL Script ?

The below statement works for me in Oracle SQL.

 

"select rtrim(xmlagg(xmlelement(state, city||',')).extract('//text()'))city,state from country group by state"

 

So Xmlagg .. is it available in Hana ?..

 

I'm not able to check for i don't have access to SQL view.

 

Thanks in advance.

 

Cheers,

Vivek


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>