SQL Server INNER JOINs in 60 seconds #shorts #sqlserver #innerjoin

preview_player
Показать описание
In this video, we'll have a look at how to connect two tables together in SQL Server using INNER JOINs.
My SQL Server Udemy courses are:
----
INNER JOINs enable you to retrieve the rows of two tables where the rows match. This is the default JOIN.
The code used in the video is:

DROP TABLE IF EXISTS table1;
DROP TABLE IF EXISTS table2;

CREATE TABLE table1
(Column1 int);

CREATE TABLE table2
(Column2 int);

INSERT INTO table1 VALUES
(3), (5), (6), (7), (8), (9), (16), (17), (18), (19);

INSERT INTO table2 VALUES
(16), (17), (18), (19), (20), (21), (22), (23), (24), (25), (27), (28), (29);

SELECT Column1
FROM table1
INNER JOIN table2
ON table1.Column1 = table2.Column2;

SELECT Column1
FROM table1 AS T1
INNER JOIN table2 AS T2
ON T1.Column1 = T2.Column2;
----
Links to my website are:
Рекомендации по теме