try this:
DECLARE @a as TABLE(Eid VARCHAR(5),DocNo VARCHAR(5))
DECLARE @b-2 as TABLE(Cid VARCHAR(5),CDocNo VARCHAR(5))
DECLARE @C as TABLE(Did VARCHAR(5),EDocNo VARCHAR(5))
INSERT INTO @a
VALUES
('a','1'), ('a','2'),('a','4'), ('a','6'), ('c','3'),...