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
SET @Test = "08770871-df3b-4d02-ae40-fd9bb340b39a"; | |
SELECT UUID_FROM_BIN(T1.user_id) as UUID, group_id, | |
( | |
SELECT COUNT(id) > 0 | |
FROM contact | |
WHERE sender_id = T1.user_id AND recipient_id = UUID_TO_BIN(@Test) | |
OR sender_id = UUID_TO_BIN(@Test) AND recipient_id = T1.user_id | |
) as Is_Contact, | |
( |