What is the use of union ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the use of union ?

30th Jan 2017, 4:58 PM
jatin sharma
3 Answers
+ 2
where we want to join two query at one SQL statement.this is two types. UNION and UNION ALL
30th Jan 2017, 6:50 PM
Ajit Kushwaha
Ajit Kushwaha - avatar
0
when we use union in two sets then it gives distinct records. union all gives all the records in the set
30th Jan 2017, 7:01 PM
роорпБро░рпБроХройрпН роЪрпБроирпНродро░рокро╛рогрпНроЯро┐ропройрпН
роорпБро░рпБроХройрпН роЪрпБроирпНродро░рокро╛рогрпНроЯро┐ропройрпН - avatar
0
The SQL UNION operator combines the result of two or more SELECT statements. It removes duplicate rows between the various SELECT statements. Syntax SELECT column_name(s) FROM table1 UNION SELECT column_name(s) FROM table2; Example SELECT City FROM Customers UNION SELECT City FROM Suppliers
3rd Feb 2017, 1:06 PM
Akwin Lopez
Akwin Lopez - avatar