Currently I’m running this SQL query to retrieve custom posts for a store locator. Everything is fine except I would like for it to return items even if the “telephone” field is empty. As of now it will only pull in the ones that have that field filled in.
This is how my query looks when run:

Anyone have a clue? (Also is there a more efficient way to run this?)
SELECT wp_posts.post_title as name,
address.meta_value as address,
latitude.meta_value as lat,
longitude.meta_value as lng,
telephone.meta_value as phone,
( 3959 * acos(
cos( radians( '%s' ) ) *
cos( radians( CONVERT( latitude.meta_value, DECIMAL( 10, 6 ) ) ) ) *
cos( radians( CONVERT( longitude.meta_value, DECIMAL( 10, 6 ) ) ) - radians( '%s' ) ) +
sin( radians( '%s' ) ) * sin( radians( CONVERT( latitude.meta_value, DECIMAL( 10, 6 ) ) ) )
) ) AS distance
FROM wp_postmeta as address, wp_postmeta as latitude, wp_postmeta as longitude, wp_postmeta as telephone,
wp_posts
WHERE
(wp_posts.ID = address.post_id
AND address.meta_key = '_dealer_address' )
AND (wp_posts.ID = latitude.post_id
AND latitude.meta_key = '_dealer_latitude' )
AND (wp_posts.ID = longitude.post_id
AND longitude.meta_key = '_dealer_longitude' )
AND (wp_posts.ID = telephone.post_id
AND telephone.meta_key = '_dealer_telephone' )
Posting the answer as per Marc B’s suggestion from his comment.