This query doesn't work but I hope it will suffice to make you understand what I need:
SELECT p.ID, lat.l
FROM hlp_posts AS p
WHERE p.ID
IN (SELECT pm.post_id, pm.meta_value AS l FROM hlp_postmeta AS pm WHERE pm.meta_key = "hlp_latitude") lat
What I need is getting in the main SELECT a value (lat.l
) selected in the subquery.
I can get it through a JOIN but I can't use it.