Body: <p>Given an array of field IDs, I want to get all content for those fields.
  So, in this situation:</p>
  
  <ul>
  <li>entry 1
  <ul>
  <li>field ID 1: 'test'</li>
  </ul></li>
  <li>entry 2
  <ul>
  <li>field ID 1: 'test test'</li>
  </ul></li>
  </ul>
  
  <p>I want to end up with <code>array('test', 'test test')</code>.
  I now iterate through all content from the content table to check the field's handle against the handle of the field I'm looking for, but there must be a better way.</p>
  
  <p>See <a href="https://github.com/nilsenpaul/nptypeahead/blob/master/nptypeahead/services/NpTypeAhead_DataService.php" rel="nofollow">this service</a> to see what code I use now.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-02-04T14:37:57.760Z
Comments.Text: Hey Paul - can you post the code you are using to iterate through all the content? Are you running a SQL query?
Comments.UserDisplayName: Aaron Berkowitz
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-02-04T14:51:30.293Z
Comments.Text: I did. I posted a link to the service on Github.
Comments.UserDisplayName: Paul
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-02-05T02:51:03.930Z
Comments.Text: I've been messing around throughout the day with fancy nested SQL queries to try and simplify your service algorithm, but couldn't get anything to work...yet!
Comments.UserDisplayName: Aaron Berkowitz
Tags: <plugin-development><fieldtypes>
Title: What's the best way to get all content for a field?
ThreadText: # What's the best way to get all content for a field?
  
  (Asked by: username_0 on 2015-02-04)
  
  Given an array of field IDs, I want to get all content for those fields.
  So, in this situation:
  
  * entry 1
    + field ID 1: 'test'
  * entry 2
    + field ID 1: 'test test'
  
  I want to end up with `array('test', 'test test')`.
  I now iterate through all content from the content table to check the field's handle against the handle of the field I'm looking for, but there must be a better way.
  
  See [this service](https://github.com/nilsenpaul/nptypeahead/blob/master/nptypeahead/services/NpTypeAhead_DataService.php) to see what code I use now.
  
  **Tags:** plugin-development, fieldtypes
  
  > **Comments:**
  > **username_1**: Hey username_0 - can you post the code you are using to iterate through all the content? Are you running a SQL query?  
  > **username_0**: I did. I posted a link to the service on Github.  
  > **username_1**: I've been messing around throughout the day with fancy nested SQL queries to try and simplify your service algorithm, but couldn't get anything to work...yet!  
  
  ---
  
  ## 0 answers
  
  