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 | |
contact_user_id AS user_contact_id | |
FROM | |
user_contacts uc | |
WHERE | |
uc.user_id = 1 | |
AND EXISTS ( | |
SELECT | |
* |
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
-- ---------------------------- | |
-- Table structure for user_contacts | |
-- ---------------------------- | |
DROP TABLE IF EXISTS "public"."user_contacts"; | |
CREATE TABLE "public"."user_contacts" ( | |
"id" int8 NOT NULL DEFAULT nextval('user_contacts_id_seq'::regclass), | |
"user_id" int8 NOT NULL, | |
"contact_user_id" int8 NOT NULL | |
) | |
; |