SQL Help Required
-
I am using ELI’s Custom SQL Reports Creation plugin.
I want to produce the following SQL report (within WordPress):
Count all posts for all my Categories between two dates.
The output should be like this
Category Count
Football 10
Cricket 5
Hockey 3I have tried a few ideas but still cannot get it to work.
I can get all posts for one category i.e.
SELECT DATE_FORMAT(post_date_gmt, '%M %Y') 'Date', post_title 'Post Title' , ID FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) WHERE (wp_term_taxonomy.term_id = 134 AND wp_term_taxonomy.taxonomy = 'category' AND wp_posts.post_type = 'post' AND wp_posts.post_status = 'publish') ORDER by wp_posts.post_date_gmt DESC;
Any help will be highly appreciated with this.
Thanks in advance.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘SQL Help Required’ is closed to new replies.