I'm trying to find the similarities between two users of my application. I have tested the below query for just the interests attribute and it works fine:
SELECT interests FROM user WHERE uid=me() AND interests IN
(SELECT interests FROM user WHERE uid = $targ_id)
I want to extend this to finding the similarities over the following attributes: movies, tv, music, books
. Modifying the SELECT
statements is trivial but I am unsure how to do the IN
clause. This is what I tried doing:
SELECT interests, movies, tv, music, books FROM user WHERE uid=me()
AND (interests, movies, tv, music, books) IN
(SELECT interests, music, tv, movies, books FROM user WHERE uid = $targ_id)
This comes up with the following error:
{
"error": {
"message": "(#601) Parser error: unexpected ',' at position 82.",
"type": "OAuthException",
"code": 601
}
}
How can I adjust this FQL query to make it work?