I have two tables: customerTable
and orderTable
that are shown below. I need to generate order
column dynamically.
CustomerTable
custId CustName
01 Suresh
02 Ramesh
OrderTable
custId OrderId
01 011
01 012
need output as like :
custId Order1 Order2
01 011 012
Here if order is multiple times for each customer then columns will be added dynamically.
If custId = 01 has 011,012,013,014...... has many order then table will be like
custId order1 order2 order3 order4 order5 order6 ...... many oder N columns
01 011 012 013 014 015 06 ....... 0N..