db2 - Is there a way to Concat multiple rows into one but keep each column value as a seperate column? -


i know possible want listagg adds of values 1 column.

for example if have this

subjectid       studentname ----------      ------------- 1               mary 1               john 1               sam 2               alaina 2               edward 

i hoping this

subjectid       studentname       studentname1       studentname2  ----------      -----------       ------------       ------------ 1               mary              john               sam                2               alaina            edward             0 

this called pivoting , described in article


Comments

Popular posts from this blog

angular - DownloadURL return null in below code -

python 2.7 - Given three nested dictionaries, sort the top two nested dictionaries from a value in the innermost dictionary? -