Last active
January 11, 2019 21:52
-
-
Save anestv/ab0d58585304e9766ab5 to your computer and use it in GitHub Desktop.
User friend of owner or owner friend of user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
EXISTS (SELECT friend FROM friends WHERE `user` = '$owner' AND friend = '$user') AS ou, --Owner has User | |
EXISTS (SELECT friend FROM friends WHERE `user` = '$user' AND friend = '$owner') AS uo; --User has Owner |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment