I have a table wp_posts which contains post_date and author_id columns
I need to find the author_id from wp_posts where has posts in (all) 3 time ranges:
wp_posts.post_date BETWEEN '2012-11-05 00:00:00' AND '2012-11-10 23:59:59'
wp_posts.post_date BETWEEN '2012-11-12 00:00:00' AND '2012-11-17 23:59:59'
wp_posts.post_date BETWEEN '2012-11-19 00:00:00' AND '2012-11-25 23:59:59'
Looks simple, but I can’t figure out.
If I put AND between every date range, will always return 0.
Any ideas?
Why don’t you put OR:
EDIT:
Is this what you need?