Help me convert this MS Access crosstab query to MySQL

Discussion in 'Blogging' started by jaypabs, Apr 3, 2011.

  1. #1
    Hi,

    Can anybody help me convert the following SQL to MySQL?

    
    TRANSFORM Count(wp_posts.ID) AS CountOfID
    SELECT wp_users.user_login, Count(wp_posts.ID) AS [Total Post]
    FROM wp_posts INNER JOIN wp_users ON wp_posts.post_author = wp_users.ID
    GROUP BY wp_users.user_login
    PIVOT Format([post_date],"mmm") In ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
    
    Code (markup):
    The SQL above will simply display the username in rows and Month in column. The value is the number of post per username.
     
    jaypabs, Apr 3, 2011 IP