-1

嗨,我是使用 facebook api 的新手

我想根据以下条件获取好友状态

Get all the friends details (name, uid, status_message, posted_date) whose status update has more than 15 comments/likes 

以下查询正在为所有朋友提供状态更新

 SELECT status_id, uid , message FROM status WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())

上面的查询返回我所有朋友的更新,但我想在响应中包含对这些更新的评论和喜欢,以便我可以检查我这边的计数

还有comments表和likes表,api两者都可能与status_id列有外键关系

我们可以写一个完整的查询,比如SQL

4

1 回答 1

2

您不能在 FQL 中进行 JOIN,但您可以使用多查询来近似它们:

{
  'status': 'SELECT status_id, uid , message FROM status 
         WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())',
  'comments': 'SELECT post_id, fromid, time, text FROM comment 
         WHERE post_id IN (SELECT status_id from #status)'
}
于 2012-06-22T15:15:47.020 回答