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

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -

angular - DownloadURL return null in below code -