SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Apr 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Graphs - actor_id - distinct values not returned

    Hi,


    I am trying to find the list of 15 distinct friends who posted on my wall and I use this query,

    SELECT actor_id FROM stream WHERE source_id = me() limit 15.

    I want distinct 10 friend's id but the result contains repetitive value too, as a result I am not getting distinct 10 friend ids.

    As i understand I cannot use unique in FQL. How could I solve this?

  2. #2
    SitePoint Guru
    Join Date
    Jan 2004
    Location
    Uppsala, sverige
    Posts
    697
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    You can either use distinct or group by. Since I don't know what FQL is I can not say whether they are supported.

    Code:
    select distinct actor_id
      from stream
     where source_id = me()
     limit 15
    Code:
    select actor_id
      from stream
     where source_id = me()
     group
        by actor_id
     limit 15

  3. #3
    SitePoint Member
    Join Date
    Apr 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi swampBoogie,

    Thanks for the reply. I tried the above query and I get 'Parser error: unexpected 'group' at position 55'.
    This is my FQL

    https://graph.facebook.com/fql?q=select actor_id from stream where source_id = me() group by actor_id limit 15


    I also read from few documentations that FQL does not support group by. Could that be a reason? Please help

  4. #4
    SitePoint Guru
    Join Date
    Jan 2004
    Location
    Uppsala, sverige
    Posts
    697
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    If neither distinct nor group by is supported I can't help you. If there is some support forum for FQL you might ask there.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •