这是我要找的东西:
选择 author_uid, tagged_uids, page_id from location_post where author_uid = me() 或 ( author_uid in (select uid2 from friend where uid1=me()) and me() in tagged_uids)
当我拆分查询时,它们会返回预期的结果。
即,两者
- 从 location_post 中选择 author_uid、tagged_uids、page_id where author_uid = me()
- select author_uid, tagged_uids, page_id from location_post where author_uid in (select uid2 from friend where uid1=me()) and me() in tagged_uids
按预期工作。我需要的是 2 的联合。我很想说这是 API 中的错误(或限制)
笔记:
- 如果硬编码我朋友的 id 和我的 id 之一,OR 子句本身就有效。即author_uid=<my-id> 或 (author_uid=<frnd-id> and <my-id> in tagged_uids)