How to filter data?
-
Hi!
I would like to make a report which will show how many posts are made by selected author. But, I dont know how to set Filter fields to show me the list of all authors, and how to connect selected value with the query. Is it possible to do so in such way?The query is as follow:
SELECT
p.post_date AS “Date”
,u.user_nicename as “Author”
,p.post_title AS “Title”
FROM wp_posts as p
JOIN wp_users as u on u.ID = p.post_author
WHERE p.post_status <> ‘trash’
and date(p.post_date) >= date_add(now(), INTERVAL -1 MONTH)
ORDER BY date(post_date) desc
- The topic ‘How to filter data?’ is closed to new replies.