CREATE TABLE a (
call_id character varying,
receive_id character varying
);

INSERT INTO a (call_id, receive_id) VALUES ('x', 'y');
INSERT INTO a (call_id, receive_id) VALUES ('y', 'z');
INSERT INTO a (call_id, receive_id) VALUES ('p', 'z');



CREATE TABLE b (
entity_id character varying,
parent character varying
);

INSERT INTO b (entity_id, parent) VALUES ('x', 'a');
INSERT INTO b (entity_id, parent) VALUES ('y', 'b');
INSERT INTO b (entity_id, parent) VALUES ('z', 'b');
INSERT INTO b (entity_id, parent) VALUES ('p', 'c');



SELECT *
FROM A
WHERE (SELECT B.parent FROM B WHERE B.entity_id = A.call_id)
!= (SELECT B.parent FROM B WHERE B.entity_id = A.receive_id)
;