title: Facebook FQL: Get the post_id where a photo with ID XXX is used as attachment
body: <p>I have a special problem and hope, someone can help me out of this.</p>
  
  <p>My target: I have an object_id of a photo (and the pid and aid) and I want to know which posting on a page has this photo as attachment.</p>
  
  <p>My current status:</p>
  
  <pre><code>SELECT post_id, actor_id, message, type, attachment FROM stream WHERE 1 
  AND post_id = "111111_222222"
  AND source_id = 111111
  AND attachment.fb_object_id = "111111_333333"
  AND type = 247
  </code></pre>
  
  <p>This leads me to the posting, which has the photo as attachment. Obviously, cause I am searching with the "post_id".
  But if I remove the 'AND post_id = "111111_222222"' Facebook sends me no data.</p>
  
  <pre><code>SELECT post_id, actor_id, message, type, attachment FROM stream WHERE 1 
  AND source_id = 111111
  AND attachment.fb_object_id = "111111_333333"
  AND type = 247
  </code></pre>
  
  <p>Does anybody know, how to get the post_id where a photo with ID XXX is used as attachment.</p>
  
  <p>Thanks for your patience.</p>