UNION DISTINCT
combines the two results and removes duplicates
SELECT *
FROM students
WHERE id < 10
UNION DISTINCT
SELECT *
FROM students
WHERE id > 5
The query is equivalent to the above query because
DISTINCT
is the default behavior
SELECT *
FROM students
WHERE id < 10
UNION
SELECT *
FROM students
WHERE id > 5
by Valeri Tandilashvili
4 years ago
MySQL
UNION
Full MySQL Course for Beginners
1
Pro tip: use ```triple backticks around text``` to write in code fences