d0ad381833
* test: add spark query unit test and check grammar * test: add select explain、lateralSubQuery、transform unit test * chore: fileName exchange --------- Co-authored-by: dilu <dilu@dtstack.com>
32 lines
945 B
SQL
32 lines
945 B
SQL
-- [ ( ] relation [ ) ] EXCEPT | MINUS [ ALL | DISTINCT ] [ ( ] relation [ ) ]
|
|
|
|
-- Use number1 and number2 tables to demonstrate set operators in this page.
|
|
SELECT * FROM number1;
|
|
|
|
SELECT * FROM number2;
|
|
|
|
SELECT c FROM number1 EXCEPT SELECT c FROM number2;
|
|
|
|
SELECT c FROM number1 MINUS SELECT c FROM number2;
|
|
|
|
SELECT c FROM number1 EXCEPT ALL (SELECT c FROM number2);
|
|
|
|
SELECT c FROM number1 MINUS ALL (SELECT c FROM number2);
|
|
|
|
-- [ ( ] relation [ ) ] INTERSECT [ ALL | DISTINCT ] [ ( ] relation [ ) ]
|
|
|
|
(SELECT c FROM number1) INTERSECT (SELECT c FROM number2);
|
|
|
|
(SELECT c FROM number1) INTERSECT DISTINCT (SELECT c FROM number2);
|
|
|
|
(SELECT c FROM number1) INTERSECT ALL (SELECT c FROM number2);
|
|
|
|
|
|
-- [ ( ] relation [ ) ] UNION [ ALL | DISTINCT ] [ ( ] relation [ ) ]
|
|
|
|
(SELECT c FROM number1) UNION (SELECT c FROM number2);
|
|
|
|
(SELECT c FROM number1) UNION DISTINCT (SELECT c FROM number2);
|
|
|
|
SELECT c FROM number1 UNION ALL (SELECT c FROM number2);
|