select t1.courseid, t1.sem, t1.period from table1 t1 inner join table2 t2 on t1.courseid = t2.courseid and t1.sem = t2.sem and t1.period=t2.period
select courseid, sem,period from table1 INTERSECT select courseid, sem,period from table2
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)