Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT P.post_title, P.post_content, P.post_author,
- PM1.meta_value AS lat,
- PM2.meta_value AS lng
- FROM wp_posts AS P
- LEFT JOIN wp_postmeta AS PM1 ON ( P.ID = PM1.post_id AND PM1.meta_key = 'ex_latitude' )
- LEFT JOIN wp_postmeta AS PM2 ON ( P.ID = PM2.post_id AND PM2.meta_key = 'ex_longitude' )
- WHERE 1=1
- AND (
- PM1.meta_key = 'ex_latitude' OR
- PM2.meta_key = 'ex_longitude'
- )
- AND P.post_type = 'post'
- AND P.post_status = 'publish'
- GROUP BY P.ID
- ORDER BY P.ID DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement