I'm trying to develop this code:
$users = $facebook->api(array(
'method' => 'fql.query',
'query' => "SELECT uid, last_name, pic_big"
+ " FROM user WHERE uid IN ("
+ " SELECT uid"
+ " FROM page_fan"
+ " WHERE page_id='411133928921438'"
+ " AND uid IN ("
+ " SELECT uid2 FROM friend WHERE uid1 = me()"
+ " )"
+ ")"
));
The idea is that i don't want to use the operator IN but NOT IN, but FQL doesn't support operators like NOT IN, EXCEPT... How can i do it with FQL?...
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:
Just found a way to do
NOT IN
and had to share the happy news ;)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.
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.