Created
September 11, 2009 12:46
-
-
Save pjf/185278 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Selecting all friends who are interested in a particular hobby should be easy, right? | |
Well, it is, provided you're happy to do subselects, and realise the hobbies come back as a giant string. | |
Luckily, all that hard work can be pushed off to the FQL server... | |
--- | |
SELECT name | |
FROM user | |
WHERE uid IN ( | |
SELECT uid2 | |
FROM friend | |
WHERE uid1 = '$me' | |
) | |
AND ( | |
strpos(activities, '$hobby') >= 0 OR | |
strpos(interests, '$hobby') >= 0 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment