Date from customers left join orders customers orders union select
CHAPTER 27 |
---|
SQL Unions Clause
The SQL UNION clause/operator is used to combine the results of two or more SELECT statements without returning any duplicate rows.To use UNION, each SELECT must have the same number of columns selected, the same number of column expressions, the same data type, and have them in the same order, but they do not have to be the same length.
Here given condition could be any given expression based on your requirement.
Example:
Consider the following two tables, (a) CUSTOMERS table is as follows:
|
---|
Now, let us join these two tables in our SELECT statement as follows:
The UNION ALL operator is used to combine the results of two SELECT statements including duplicate rows.
The same rules that apply to UNION apply to the UNION ALL operator.
Here given condition could be any given expression based on your requirement.
TUTORIALS POINT
Simply Easy Learning