I'm working on a Wordpress project and since the wp_postmeta table saves each piece of data in its own record, I assume I'd need to perform a self join and a subquery to get the results I want.

I'm searching the DB for latitude/longitude coords per input location. I'd imagine this should work, but for some reason the WHERE clause isn't filtering anything...

SELECT lat.meta_value AS lt, lng.meta_value AS lg
FROM wp_postmeta AS lat
INNER JOIN wp_postmeta AS lng USING(post_id)
WHERE lat.post_id = (SELECT post_id FROM wp_postmeta WHERE meta_key = 'location_name' AND meta_value = 'some_sample_location' LIMIT 1)
AND lat.meta_key = '_jr_geo_latitude' OR lng.meta_key = '_jr_geo_longitude'