0 votes
in SQLite by
What is UNION ALL operator? What is the difference between UNION and UNION ALL operator?

1 Answer

0 votes
by

The UNION ALL operator is used to combine the result of two or more tables using SELECT statement. The unique difference between UNION and UNION ALL operator is that UNION operator ignores the duplicate entries while combining the results while UNION ALL doesn't ignore duplicate values.

Syntax:

SELECT expression1, expression2, ... expression_n    

FROM tables    

[WHERE conditions]    

UNION ALL    

SELECT expression1, expression2, ... expression_n    

FROM tables    

[WHERE conditions];  

...