MySQL sum results into a table grid format -


i have following sql code:

select distinct members_main.membership_type, payment_method,sum(amount_paid)  members_main, members_payments members_main.contact_id=members_payments.contact_id  group members_main.membership_type,payment_method  

that returns following:

enter image description here

i want able return results in following table grid format:

enter image description here

does know if or how can within mysql?

thanks,

john

depending on data complexity either go bluefeet's way or if payment_method amount dynamic sounds need pivot table. try looking @ this.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -