orders table:
orderid product quantity trantimestamp
100 A 1 01/01/2001
100 B 2 02/02/2001
101 A 2 01/03/2001
100 A 3 01/02/2001
101 C 4 03/02/2001
102 A 1 04/02/2001
102 D 5 04/04/2001
products table:
A
B
C
D
the resultant output should sum the quantities for each product (for example, orderid 100
has two rows with product A, so it has to be summed up(1+3=4)).
output:
orderid A B C D
100 4 2
101 2 4
102 1 5
The products table in the future can increase with the new rows(new products).
The output should have to add columns dynamically fit the new rows
added in the products table. For the increase in product rows in products table, the columns should get added to the report.
orderid product quantity trantimestamp
100 A 1 01/01/2001
100 B 2 02/02/2001
101 A 2 01/03/2001
100 A 3 01/02/2001
101 C 4 03/02/2001
102 A 1 04/02/2001
102 D 5 04/04/2001
products table:
A
B
C
D
the resultant output should sum the quantities for each product (for example, orderid 100
has two rows with product A, so it has to be summed up(1+3=4)).
output:
orderid A B C D
100 4 2
101 2 4
102 1 5
The products table in the future can increase with the new rows(new products).
The output should have to add columns dynamically fit the new rows
added in the products table. For the increase in product rows in products table, the columns should get added to the report.