- 1
Plz share about union and union all concept in sql
Request
2 Respostas
+ 6
union use to combine two select statement with no duplicates. There might be some same data present in two different tables. if you not want to get those duplicates and print only one duplicate data from two or many duplicates than use Union.
If you want to get all data as well as all duplicate data satisfy some condition use union all.
Union all is faster than union because it does not check and than remove duplicate data from a query.
Note: it does not create data or remove duplicate data to table. It is only create a virtual table from your SQL query
0
Union: selects only distinct values , Union all , select all