从FQL注释表中检索最新注释

时间:2011-10-25 21:12:48

标签: comments facebook-fql

我正在尝试从FQL评论表中获取最新回复。

我目前的查询是:

"SELECT time, comments FROM comment WHERE object_id = X"

..如果我想要自SECS秒前的最新家长评论,我可以做这样的事情:

"SELECT time, comments FROM comment WHERE object_id = X AND time > SECS"

..但我想查看“评论”栏中的回复。

"SELECT object_id, text, time, comments FROM comment WHERE object_id = X and comments.create_time > SECS"

有什么想法吗?是否有一个FQL表,其中存在“评论”中的回复?

1 个答案:

答案 0 :(得分:2)

要检索最新回复,请尝试以下

SELECT text, time, id, likes, fromid, comments FROM comment WHERE   is_private = 0 AND 
object_id in (select post_fbid from comment where object_id in (select comments_fbid from   link_stat where url ='YOUR_URL')) 
ORDER BY time DESC limit 0,10

要检索评论和回复,请尝试以下方法:

SELECT text, time, id, likes, fromid, comments FROM comment WHERE   is_private = 0 AND 
object_id IN (SELECT comments_fbid FROM link_stat WHERE url ='YOUR_URL') 
or
object_id in (select post_fbid from comment where object_id in (select comments_fbid from   link_stat where url ='YOUR_URL')) 
ORDER BY time DESC limit 0,10

更新:评论字段已从表评论中删除。