SQL More Advanced Flashcards

1
Q

UNION

A

Combines the results of two or more SELECT

The SELECT statements need to have the same number of columns. Columns must have similar types. Columns from each SELECT statement must be in the same order

SELECT column1, column2 FROM table
UNION
SELECT column3, column4 FROM table2;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

UNION ALL

A

Same as UNION but deduplicates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly