Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
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.