Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT SQL_CALC_FOUND_ROWS
- wpiw_posts.*,
- wpiw_eo_events.event_id,
- wpiw_eo_events.event_id AS occurrence_id,
- wpiw_eo_events.StartDate,
- wpiw_eo_events.StartTime,
- wpiw_eo_events.EndDate,
- wpiw_eo_events.FinishTime,
- wpiw_eo_events.event_occurrence
- FROM wpiw_posts
- LEFT JOIN wpiw_eo_events
- ON wpiw_posts.ID = wpiw_eo_events.post_id
- INNER JOIN (
- SELECT wpiw_eo_events.event_id
- FROM wpiw_eo_events
- WHERE (
- wpiw_eo_events.EndDate > '2018-01-20'
- OR (
- wpiw_eo_events.EndDate = '2018-01-20'
- AND wpiw_eo_events.FinishTime > '12:41:35'
- )
- )
- ORDER BY wpiw_eo_events.StartDate ASC,
- wpiw_eo_events.StartTime ASC
- ) AS eoid
- ON eoid.event_id = wpiw_eo_events.event_id
- WHERE 1=1
- AND wpiw_posts.post_type = 'event'
- AND (
- wpiw_posts.post_status = 'publish'
- OR wpiw_posts.post_status = 'confirmed'
- OR wpiw_posts.post_status = 'private'
- )
- GROUP BY wpiw_posts.ID
- ORDER BY wpiw_eo_events.StartDate ASC,
- wpiw_eo_events.StartTime ASC
- LIMIT 7, 7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement