Cool Facebook Query Language (FQL) Queries

Ari Sternberg of Facebook submits this cool query based on the newly released FQL:
Oh yeah, also, I'm curious if you guys come up with any cool FQL queries. Here's one that you might find interesting:
SELECT uid1, uid2
FROM friend
WHERE uid1 IN (SELECT uid1 FROM friend WHERE uid2=UID)
AND uid2 IN (SELECT uid1 FROM friend WHERE uid2=UID)
AND uid1 < uid2Replace UID with the logged in user's id (e.g. 211031 for me).
This gets your whole friends map in (for me) about 5 seconds. As opposed to the many minutes that most of those friend visualization apps take using the old API and friends.areFriends.
Oh and btw, while I encourage you to try out absurd queries in the test console, please be reasonable and don't do these things in a tight loop in your program or anything. That is, you can do a big query, but don't do *too* often, or at least warn us first or something
![]()
I tried it in the test console and it works great.
Popularity: 2% [?]
Thank you for reading this post. You can now Leave A Comment (0) or Leave A Trackback.
Post Info
This entry was posted on Wednesday, February 28th, 2007 and is filed under facebook, social networking. Tagged with:You can follow any responses to this entry through the Comments Feed. You can Leave A Comment, or A Trackback.
Previous Post: Victory Records Launches MySpace Music Player »
Next Post: Facebook Enables Photo Uploads through Platform API »
Read More
Related Reading:- Errata for Programming Collective Intelligence
- Yelp Battles Supporters of the Meier Family
- Pictures of Lori Drew
- Picture of Curt Drew
- Brandon Antron Rolle Goes on Trial Today
- Fixing Spurious Rails Routing Error
- MySpace Stumbles Playing Catchup to Facebook with Status Updates “Friendsmoods”
- MySpace API Unveiled
- Yelp’s Hangout Joins the Facebook Parade
- Facebook the Transformers of Social Networking





