Skip to content
Advertisement

sql Tables manipulation

tables

Hi everyone,

i have the above table ‘given table’ i would like to create a new table with columns ‘product’, ‘paid’ , ‘branchA’ and ‘branchB’ as shown in the ‘desired output table’ with the unique identifier column ‘id’. This must be a simple sql task, but here i am. Any constructive suggestions or code samples are welcome. thx in advance

Advertisement

Answer

There are probably a number of ways to do this. Make sure that you fully understand whichever one you choose.

My approach is to union the first set of columns together with the second set.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement