Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT SQL_CALC_FOUND_ROWS wp_2_posts.* FROM wp_2_posts
- LEFT JOIN wp_2_term_relationships AS trel ON (wp_2_posts.ID = trel.object_id)
- LEFT JOIN wp_2_term_taxonomy AS ttax ON ( ( ttax.taxonomy = 'category' OR ttax.taxonomy = 'post_tag' OR ttax.taxonomy = 'post_format' ) AND trel.term_taxonomy_id = ttax.term_taxonomy_id)
- LEFT JOIN wp_2_terms AS tter ON (ttax.term_id = tter.term_id)
- LEFT JOIN wp_2_postmeta AS m ON (wp_2_posts.ID = m.post_id)
- WHERE 1=1 AND
- wp_2_posts.post_type='event' AND
- wp_2_posts.ID in (
- select p.ID from wp_2_posts p where p.post_type='event' and p.ID in (
- select pm.post_id from wp_2_postmeta pm
- where
- pm.meta_key like 'st_date' and
- pm.meta_value <= "2011-11-13" and
- pm.post_id in (
- (select pm.post_id from wp_2_postmeta pm
- where
- pm.meta_key like 'end_date' and
- pm.meta_value>="2011-11-13"
- )
- )
- )
- )
- and wp_2_posts.post_status in ('publish','private')
- ORDER BY wp_2_posts.post_date
- DESC LIMIT 0, 6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement