I have two tables in my SQL Server database. The first is Test1 and second is Test2. There is a column RegNo in both tables.
Test1
Test2
RegNo
Now I
Here is your query with correction.
SELECT Test1.SurName, Test2.Class, Test2.Medium FROM Test1 INNER JOIN Test2 ON Test1.RegNo = Test2.RegNo where Test2.RegNo=Test1.RegNo;
Also you can filter the query by providing the RegNo,on whichEver table u want.