Get only used meta_values
I am not sure if I get your question right, and thus don’t know if this answer goes into the right direction… Is this what you’re trying to achive? $apart_locations = $wpdb->get_col( “SELECT meta_value FROM $wpdb->postmeta AS wppm LEFT JOIN $wpdb->posts AS wpp ON wppm.post_id = wpp.ID WHERE wppm.meta_key = ‘postal_location’ AND wpp.post_status=”publish” ORDER BY … Read more