All language subtitles for 11. Union

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

0 Next, we are going to discuss the union operator. 1

Union operator combines the result sets of two or more select statement. 2

So in except we saw that it is giving us the ResultSet of one table, and from that it removed 3

the result set of other table. union is combining both of these ResultSet and while combining 4

the duplicate rows from both, the result sets will be removed. 5

So it will be similar to the select distinct. 6

So the syntax for this union operators, you select the expressions that you want from table one, you 7

can specify where conditions also. 8

Then you write union, just like we wrote, except then you specify the second select condition with expressions. 9

One thing to note here is for expression 1 in the first statement and expression 1 in the second 10

statement. 11

These two should have the same data types if expression, one in first selected statement is integer then it should be 12

integer 13

in the second select statement also and the number of expressions in the first select statement, if it is n 14

here, it should be. 15

n in the second select statement also. you can specify more than two select statements using multiple 16

unions. 17

Let us look at an example. 18

Suppose you want to find out all the customer ideas that you have in your database, either they are 19

present in the sales table or they are present in the customer table. 20

To do that, to get that combined customer ID table, we will use the union operator will write select customer 21

Id from sales table. 22

And Union select customer id from customer table, and we will order this by the customer id. 23

Let's go right this so select customer id from sales table 24

union select customer id from customer table 25

order by customer Id. 26

Just compare that this is exactly same as the except query that we wrote just that except it replaced 27

by Union. Let us run this query 28

You can see 10315, which is not president in the customer table is present in our ResultSet, 29

10375 is part of both. 30

And it is President in the ResultSet, 10480 which is not part of sales table, is present in this result set 31

So basically, all the customer ids are present in our result set. This is how we use union and this completes the 32

joins and other table combination operators.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.