title: How do I select from multiple rows in wp_postmeta table using wpdb select statement Wordpress
body: <p>I have a select statement like this:</p>
  
  <pre><code>   $results = $wpdb-&gt;get_results( "SELECT $wpdb-&gt;postmeta.meta_value 
     FROM $wpdb-&gt;postmeta    
     WHERE 1=1 AND $wpdb-&gt;postmeta.meta_key = 'geo_short_address'" );
  </code></pre>
  
  <p>But I'm now trying to filter this statement to only include those 'geo_short_address' that also have an entry or not empty in a meta-key field called '_Company'</p>
  
  <p>They have the same post id, for instance:</p>
  
  <pre><code>    post_id        meta_key           meta_value
         53     geo_short_address      Nottingham
         53        _Company            Ledgemonkey
  </code></pre>
  
  <p>So I only want to return Nottingham if the meta_key <code>_Company</code> exists in the <code>post_id</code></p>
  
  <p>There are other entries in the DB that will not have the meta_key <code>_Company</code> they are the ones I want to exclude ...?</p>
  
  <p>I have tried various things but can't seem to get the combination..?</p>