Random Friend using FQL
I am right now using fql which brings all the friend list in array. Then I sort that array to get a random friend. But it seems to take long time since i have to collect all the friends to get single random friend. How do i go this in fql to get random friend? SELECT uid, name, pic, sex FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me()) SELECT uid, name, pic, sex FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me()) order by rand() limit 1 来源: https://stackoverflow.com/questions/11465976/random-friend-using-fql