title: Facebook FQL - Combine queries to get album info and cover photo info from fanpage
body: <p>I am using Facebook FQL to get the album's for a fanpage on facebook. Using this query:</p>
  
  <pre><code>SELECT name, description, cover_object_id, photo_count
      FROM album
      WHERE aid IN (SELECT aid FROM album WHERE owner = myPageID) ORDER BY name
  </code></pre>
  
  <p>After running the query. I get the following JSON payload response, which works just fine:</p>
  
  <pre><code>{
    "data": [
      {
        "name": "Cover Photos",
        "description": "",
        "cover_object_id": "654243601289015",
        "photo_count": 1
      },
      {
        "name": "Profile Pictures",
        "description": "",
        "cover_object_id": "630449460335096",
        "photo_count": 1
      },
      {
        "name": "The Artists",
        "description": "Code Sound Studio's Artists, DJ's, and Producers",
        "cover_object_id": "657888117591230",
        "photo_count": 19
      },
      {
        "name": "The Party",
        "description": "Code Sound Studio's Legendary Listening Party's!",
        "cover_object_id": "657361990977176",
        "photo_count": 15
      },
      {
        "name": "The Venue",
        "description": "",
        "cover_object_id": "654241957955846",
        "photo_count": 26
      },
      {
        "name": "Timeline Photos",
        "description": "",
        "cover_object_id": "654235904623118",
        "photo_count": 1
      }
    ]
  }
  </code></pre>
  
  <p>The only problem is that I also need to get the <strong><em>url</strong> of the <strong>cover photo</em></strong> (cover_object_id).</p>
  
  <p>I can do that by running this query:</p>
  
  <pre><code>SELECT src FROM photo WHERE object_id IN 
  (SELECT cover_object_id
      FROM album
      WHERE aid IN (SELECT aid FROM album WHERE owner = myPageID) ORDER BY name)
  </code></pre>
  
  <p>response:</p>
  
  <pre><code>{
    "data": [
      {
        "src": "https://fbcdn-photos-g-a.akamaihd.net/hphotos-ak-ash3/1454787_654243601289015_585991542_s.jpg"
      },
      {
        "src": "https://fbcdn-photos-e-a.akamaihd.net/hphotos-ak-prn1/14172_630449460335096_1873290265_s.jpg"
      },
      {
        "src": "https://fbcdn-photos-g-a.akamaihd.net/hphotos-ak-ash3/1463472_657888117591230_1518187687_s.jpg"
      },
      {
        "src": "https://fbcdn-photos-b-a.akamaihd.net/hphotos-ak-ash4/1457606_657361990977176_792893563_s.jpg"
      },
      {
        "src": "https://fbcdn-photos-a-a.akamaihd.net/hphotos-ak-ash3/541847_654241957955846_1499266298_s.jpg"
      },
      {
        "src": "https://fbcdn-photos-g-a.akamaihd.net/hphotos-ak-frc3/1475898_654235904623118_509667066_s.jpg"
      }
    ]
  }
  </code></pre>
  
  <p>Is there a way to combine the 2 queries into one request?  </p>