declare @A table(ID int, col1 varchar(50))
declare @B table(col2 varchar(50), col3 varchar(50))
declare @C table(ID int, col4 varchar(50))
INSERT INTO @A(ID, col1) values(1, 'abc')
INSERT INTO @A(ID, col1) values(2, 'bcd')
INSERT INTO @B(col2, col3) values('bcc' , 'abc')
INSERT INTO @B(col2, col3) values('acc' , 'bcd')
INSERT INTO @C(ID, col4) values('1' , 'qwe')
INSERT INTO @C(ID, col4) values('1' , 'tre')
INSERT INTO @C(ID, col4) values('1' , 'uid')
INSERT INTO @C(ID, col4) values('2' , 'jkj')
INSERT INTO @C(ID, col4) values('2' , 'jwekj')
-- The query
SELECT a.ID, a.col1, b.col2, (SELECT COUNT(c.ID) FROM @C c WHERE c.ID = a.ID) CNT
FROM @A a join @b b ON a.col1 = b.col3