0

我正在构建一个需要查询 Facebook 事件的网站。我需要一份我拥有的事件列表,以及我不拥有的事件列表。问题是通过 FQL 查询事件对象需要我传递可索引字段之一。这些是创建者、名称和开斋节。当我需要我的事件(创建者 = 我())时,这很好。但是,当我需要我不拥有的事件时,我似乎无法在 (creator <> me()) 中使用类似 SQL 的语句。

关于如何做到这一点的任何建议?

SELECT name,start_time,end_time,location,eid,pic,description FROM event where creator = me() and start_time >= 1370106582

4

1 回答 1

0

它不像我想的那么简单,但是这个查询有效。

SELECT name,start_time,end_time,location,eid,pic,description FROM event where eid IN
 (SELECT eid FROM event_member WHERE uid = {UserId} and inviter and rsvp_status = 'attending')


如果您通过用户 ID 查询 event_member,则 Inviter 字段对于他们是所有者的事件为空。在 FQL 中,如果您只是在 where 子句中添加 'Where {field}',它会返回该字段值不为空的所有结果。我知道这有点令人困惑,但它确实有效。

于 2013-06-09T21:04:02.593 回答