I need to find all of the friends of a specific user who have already installed my application.
SELECT uid FROM user WHERE has_added_app = 1 AND uid IN (SELECT uid2 FROM friend WHERE uid1 = $user);
This particularly comes in handy when you’re displaying an
control in FBML and want to exclude friends of the current
loggedinuser who have already installed your
app (see Invitations and Requests).