Question

Here is what i'm looking for:

select author_uid, tagged_uids, page_id from location_post where author_uid = me() or ( author_uid in (select uid2 from friend where uid1=me()) and me() in tagged_uids)

When i split the queries they return the expected results.

i.e, both

  1. select author_uid, tagged_uids, page_id from location_post where author_uid = me()
  2. 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

work as expected. What I need is a union of the 2. I'm tempted to say this is either a bug (or a limitation) in the API

Note:

  1. The OR clause itself works if the hard code one of my friend's id and my id. i.e author_uid=<my-id> or (author_uid=<frnd-id> and <my-id> in tagged_uids)
Était-ce utile?

La solution

The problem was me() in the query. I had the user's ID around and replace me() with the actual ID did the the job

SELECT id, author_uid, page_id, tagged_uids, timestamp, coords FROM location_post WHERE (&lt;id> IN tagged_uids or author_uid = &lt;id>)

Autres conseils


What you are attempting to do will not work. You could try and run a multi-query and get back the results at once and compare them on your end.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top