try this once
Code:
declare @tbl table(DocID int, Word varchar(23),Freq int)
insert into @tbl select
1 , 'English', 1
insert into @tbl select
1, 'Lesson', 2
insert into @tbl select
1 , 'Work', 2
insert into @tbl select
1, 'Training', 2
insert into @tbl select
2, 'English', 2
insert into @tbl select
2, 'Have', 2
insert into @tbl select
3, 'Lesson', 3
insert into @tbl select
3 , 'Chinese', 2
select s.word, SUM(s.freq)as freq
from @tbl s inner join @tbl t on t.word = s.word and t.docid <> s.docid
where s.docid in (1,2) and t.docid in (1,2)
group by s.word