Click here to Skip to main content
15,908,776 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

A                B                      C          D 
20070068	Avenues	                Q2	Q2/14-15
20070068	Avenues	                Q3	Q3/14-15
20070068	Avenues	                Q4	Q4/14-15
20080402	J S Distributors	Q2	Q2/14-15
20080402	J S Distributors	Q3	Q3/14-15
20080402	J S Distributors	Q4	Q4/14-15

I have data like above in MySql. My question is how to pivot this as like the below,
                                      Q2/14-15        Q3/14-15      Q4/14-15
20070068	Avenues                  10              20            30
20080402	J S Distributors         30              30            30
Updated 4-Aug-15 2:59am
Maciej Los 4-Aug-15 9:00am    
What have you tried? Where are you stuck?

Share this answer
A nice sample how to create pivot data in MySql:[^]
Share this answer
Member 10556393 4-Aug-15 10:17am    
Hi Kornfeld Eliyahu Peter,
Thanks for your reply. I already visit this link, but it is sum of tables only there.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900