SQL Union Tutorial with Example (UNION ALL)

preview_player
Показать описание
In this video, we take a look at the UNION Operator in SQL by providing a tutorial and example.

The UNION operator is used to vertically stack two or more SQL statement result sets together.

Prerequisites for the Union to work is that each SQL Statement being "unioned" MUST:
-have the same number of columns
-must have the similar datatypes among those columns
-must have the columns sequenced in the same order

Effectively, this means each select statement output must be structurally identical.

Additionally, the UNION ALL operator may be used to enable any duplicate values to flow into the output. Otherwise, by using the UNION operator, only distinct rows will be shown.

Content -
0:00 - Intro / Illustration of Union Operator
0:33 - Explanation
1:32 - Walkthrough of Union with an Example

#sql #sql101 #sqlinterview
Рекомендации по теме
Комментарии
Автор

Why have you stopped making videos?
your contents are straight and to the point.

BTW your videos are really helpful ❤

stymsaw