facebook fql select statement examples

sponsored links
Here now are the FQL queries, each with a short description. For each query, replace 00000000 with your Facebook ID number.
1. Profile information of friends (Update 3; added "quotes" on 3 Jan 2010): SELECT uid, first_name, last_name, name, pic_big, affiliations, religion, birthday, birthday_date, sex, hometown_location, political, current_location, activities, interests , music, tv, movies, books, quotes, about_me, hs_info, education_history, work_history, profile_url, profile_blurb, family, username, website FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = 00000000)

2. Events you have attended: SELECT eid, name, tagline, pic_big, host, description, event_type, event_subtype, start_time, end_time, creator, location, venue FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid = 00000000 AND rsvp_status = "attending")

3. Your friend lists: SELECT flid, name FROM friendlist WHERE owner = 00000000

4. The members of your friend lists: SELECT flid, uid FROM friendlist WHERE flid IN (SELECT flid FROM friendlist WHERE owner = 00000000)

5. Your notes: SELECT note_id, title, created_time, content FROM note WHERE uid = 00000000

6. Comments on your notes: SELECT object_id, post_id, fromid, time, text FROM comment WHERE object_id IN (SELECT note_id FROM note WHERE uid = 00000000)

7. Pages you're a fan of: SELECT page_id, name, pic_big, website, type FROM page WHERE page_id IN (SELECT page_id FROM page_fan WHERE uid = 00000000)

8. Links you have posted: SELECT link_id, owner_comment, created_time, title, summary, url, image_urls FROM link WHERE owner = 00000000

9. Threads in your inbox (requires "read_mailbox" permissions): SELECT thread_id, folder_id, subject, recipients, updated_time, parent_message_id, parent_thread_id, message_count, snippet, snippet_author, object_id FROM thread WHERE folder_id = 0

10. Threads in your outbox (requires "read_mailbox" permissions): SELECT thread_id, folder_id, subject, recipients, updated_time, parent_message_id, parent_thread_id, message_count, snippet, snippet_author, object_id FROM thread WHERE folder_id = 1

11. Messages in your inbox (requires "read_mailbox" permissions): SELECT message_id, thread_id, author_id, body, created_time, attachment FROM message WHERE thread_id IN (SELECT thread_id FROM thread WHERE folder_id = 0)

12. Messages in your outbox (requires "read_mailbox" permissions): SELECT message_id, thread_id, author_id, body, created_time, attachment FROM message WHERE thread_id IN (SELECT thread_id FROM thread WHERE folder_id = 0)

13. Your wall posts (requires "read_stream" permissions): SELECT post_id, app_id, source_id, updated_time, created_time, attribution, actor_id, target_id, message, app_data, action_links, attachment, comments, likes, privacy, permalink, tagged_ids, is_hidden FROM stream WHERE source_id = 00000000

14. Comments on your wall posts (requires "read_stream" permissions): SELECT post_id, fromid, time, text FROM comment WHERE post_id IN (SELECT post_id FROM stream WHERE source_id = 00000000)

15. Your photo albums: SELECT aid, cover_pid, name, created, modified, description, location, size, link, visible, modified_major, type, object_id FROM album WHERE owner = 00000000
16. Comments on your photo albums: SELECT object_id, post_id, fromid, time, text FROM comment WHERE object_id IN (SELECT object_id FROM album WHERE owner = 00000000)

17. Your photos: SELECT pid, aid, src_big, src_big_height, src_big_width, link, caption, created, modified, object_id FROM photo WHERE aid IN (SELECT aid FROM album WHERE owner = 00000000)

18. Comments on your photos: SELECT object_id, post_id, fromid, time, text FROM comment WHERE object_id IN (SELECT object_id FROM photo WHERE aid IN (SELECT aid FROM album WHERE owner = 00000000))

19. Your videos: SELECT vid, title, description, thumbnail_link, embed_html, updated_time, created_time FROM video WHERE owner = 00000000

20. Comments on your videos: SELECT object_id, post_id, fromid, time, text FROM comment WHERE object_id IN (SELECT vid FROM video WHERE owner = 00000000)

21. Groups you're a member of: SELECT gid, name, nid, pic_big, description, group_type, group_subtype, recent_news, creator, update_time, office, website, venue, privacy FROM group WHERE gid IN (SELECT gid FROM group_member WHERE uid = 00000000)

22. People tagged in your photos (Update 2; added 2 Jan 2010): SELECT pid, subject, text, xcoord, ycoord, created FROM photo_tag WHERE pid IN (SELECT pid FROM photo WHERE aid IN (SELECT aid FROM album WHERE owner = 00000000))

23. People tagged in you videos (Update 5; added 4 Jan 2010): SELECT vid, subject FROM video_tag WHERE vid IN (SELECT vid FROM video WHERE owner = 00000000)
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of facebook fql select statement examples

  • Js magnifying effect of the chrome components add support qsoft.PopBigImage.v0.35

    qsoft.PopBigImage.v0.35.demo.rar New features: 1, Do not need to load and onload the id specified in the img tag in a good add, the first dynamically generated when the mouse to enter the show floor 2, can be adjusted, the right to display the size o ...

  • Hibernate data retention

    Hibernate data retention - Session. Save Ways Session.save user entity objects to the database persistence operations. In other words, Session.save method call with the entity object by matching Insert SQL, data insert database table. Ways Session.sa ...

  • hibernate one-to-one mapping

    hibernate one-to-one primary key association mapping (two-way association Person <----> IdCard) Required in the mapping file idcard add tags <one-to-one> point person, how to load the person instructions hibernate According to the primary key

  • Uncover the hood of j2ee clustering

    Source article: http://www.theserverside.com/tt/articles/article.tss?l=J2EEClustering Article discussion: http://www.theserverside.com/news/thread.tss?thread_id=35831 Preface More and more mission-critical and large scale applications are now running on J

  • Hibernate Search, Lucene

    First of all, we need to be added to the configuration in the persistence.xml as follows: <! - Use a file system based index -> <property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSDirect

  • Ruby numerical types and string types

    Next Ruby novice, there is a master problem, please help answer this question: Say Ruby book on basic data types are objects, may be why the numerical type of object_id is the same, two different "5" are the same object, and string type is ...

  • hibernate's HQL query

    Medium at HQL keywords are not case-sensitive, but the property and the class name is case-sensitive 1, a simple query property * A single property query, return the result set list property, element type and entity type of the corresponding property type

  • Topsy Ruby Series: Topsy Symbol

    Learn Ruby would Symbol it puzzled me too, so look to spend more time Symbol. Symbol Chinese name symbols, because the tags are used to a certain kind of things. Early read some information, in my mind, feel like a String, like Symbol, you can visit ...

  • hibernate in the get method and the difference between load method

    hibernate in the get method and the load method of the fundamental difference is: If you use the load method, hibernate consider the corresponding object id (database records) are in the database must exist, so it can be assured that the use, it can be as

  • Hibernate in the inverse and cascade

    First of all, to quote another blog saying: 1.cascade ="..."? cascade is not a property of many-to-many relationship must have it just so that we insert or delete at the time like some more convenient, as long as the source of the cascade insert

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries