Skip to content

Instantly share code, notes, and snippets.

@alexoro
Created September 11, 2013 12:00
Show Gist options
  • Save alexoro/6522610 to your computer and use it in GitHub Desktop.
Save alexoro/6522610 to your computer and use it in GitHub Desktop.
SELECT friends._id, friends.global_first_name, friends.global_last_name, friends.friend_first_name, friends.friend_last_name, friends.status_text, friends.avatar_url
LEFT OUTER JOIN buddies ON buddies._id =
(SELECT buddies_contacts.buddy_id FROM buddies_contacts WHERE buddies_contacts.contact_hash IN
(SELECT friends_contacts.contact_hash FROM friends_contacts WHERE friends_contacts.private_user_id = friends.private_user_id))
FROM friends_contacts
WHERE type = ?
ORDER BY global_first_name COLLATE LOCALIZED ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment