How to select values from two different tables in SQL

后端 未结 7 1574
醉梦人生
醉梦人生 2021-02-08 16:15

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.

Now I

7条回答
  •  耶瑟儿~
    2021-02-08 16:31

    SELECT Test1.SurName, Test2.Class, Test2.Medium
    FROM Test1
    INNER JOIN Test2
    ON Test1.RegNo = Test2.RegNo
    

    please see a visual explanation of joins this is very helpful in learning joins.

提交回复
热议问题