2

I have some issue with a Facebook's fql request :).

When I request like this

SELECT uid, profile_url FROM user where contains('potatoe') OR uid in(select id from profile where contains ('potatoe')) ORDER BY mutual_friend_count desc LIMIT 0,2

I have always the same results, even if I change the offset...

But

  • If I change DESC to ASC the "offset" works...
  • If I change OR to AND and let the order by desc => the "offset" works too!

Something is wrong with my OR/desc/offset combo? Or I just have misunderstood something with "or" operators? :/

Thanks a lot.

4

2 回答 2

2

您应该这样编写 FQL 查询:

从用户中选择 uid、profile_url

where uid in(select uid from user where contains ('potatoe') )

或 uid in(从包含 ('potatoe') 的配置文件中选择 id)

ORDER BYmutual_friend_count desc

限制 0,2

FQL 无法在布尔表达式中解释“包含”的结果,因此您的 OR 运算符在这里失败...

于 2013-03-21T14:28:13.537 回答
0

我认为问题在于您的查询以两种不同的方式提出同一个问题:

  • 显示我所有包含“土豆”的朋友用户资料
  • 显示属于我的朋友的用户的所有个人资料,其中包含“土豆”。

简化您的查询,看看它是否按预期工作。

SELECT uid, profile_url FROM user WHERE contains('potatoe')
   ORDER BY mutual_friend_count DESC LIMIT 0,2
于 2013-03-21T13:36:59.033 回答