Thanks for the reply.
Sorry for the confusion, a small change in the table3 fields
I dont know how to do inner join.
i tried like this, but it gives error.
It will be greatful, if you can point out where i have gone wrong?
OR is this not the way?
select top 100 percent dbo.table1.[compid] from dbo.table1 inner join
dbo.table2 on dbo.[table3]
where dbo.table2.[recordid] = dbo.[table3].[recID]