FQL NOT IN Equivalent operator like <> , EXCEPT, !=

孤街浪徒 提交于 2019-12-06 16:07:15
Raul Rene

There is no NOT IN operator in FQL. You could do a simple select using IN and use PHP for negation. It's a little overhead, but as far as I know it's the only way.

I found a related post: link here.

Facebook does support NOT IN. You just have to wrap it in enough parantheses.

For example, to find the users attending an event who are not the current user or friends wth the current user:

SELECT uid, name FROM user WHERE uid IN (
  SELECT uid FROM event_member WHERE eid=209798352393506
)
AND NOT (uid=me())
AND NOT (uid IN (
  SELECT uid1 FROM friend WHERE uid2=me()
))

Just found a way to do NOT IN and had to share the happy news ;)

SELECT post_id, actor_id, message FROM stream WHERE source_id in(a, b, c) and NOT (actor_id in (a, b, c))

This will get the messages from multiple pages by unkown users, i.e. all posts by users or pages that are not the pages themselves, aka fans.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!