如何使用FQL multi-query
获取我朋友的个人资料图片创建日期?
我在下面写了一下查询:
SELECT src_small, src_big, src FROM photo WHERE src IN
(SELECT pic_square, pic_small, pic_big, pic FROM user WHERE uid IN
(SELECT uid2 FROM friend WHERE uid1 = me()) )
但它说:
{
"error": {
"message": "Your statement is not indexable. The WHERE clause must contain an indexable column. Such columns are marked with * in the tables linked from http://developers.facebook.com/docs/reference/fql ",
"type": "NoIndexFunctionException",
"code": 604
}
}
提前致谢。
答案 0 :(得分:2)
来自Arjuna Del Toso的评论:
只有将WHERE子句中的列标记为“可索引”
时,才能使用该列
不,这不完全正确。
你的where子句中至少需要至少一个可索引列 - 一旦你有了,你也可以使用其他非索引列来进一步限制结果。
由于用户当前的个人资料图片始终是个人资料图片相册的专辑封面照片,我们可以使用它来获取个人资料的object_id
我们朋友的照片,而不是用它来从photo
表中选择我们想要的信息:
SELECT owner, src_small, created FROM photo WHERE object_id IN (
SELECT cover_object_id FROM album WHERE owner IN (
SELECT uid1 FROM friend WHERE uid2 = me()
) AND name = 'Profile Pictures'
)