Leveling up your mind

Notifications
Clear all

UNION Clause

 
Sohaib
(@sohaib-ops)
Member Admin

The UNION clause is used to combine results that appear from multiple SELECT statements and filter duplicates.

For example, given a first_names table with a column name containing rows of data “James” and “Hermione”, and a last_names table with a column name containing rows of data “James”, “Hermione” and “Cassidy”, the result of this query would contain three names: “Cassidy”, “James”, and “Hermione”.

 

SELECT name FROM first_names UNION SELECT name FROM last_names

 

Quote
Topic starter Posted : 06/06/2020 2:44 am