SQL Union
The UNION
operator is used to combine the result sets of two SELECT queries. It removes duplicate rows from the result set.
Example: Using UNION
SELECT Name FROM FreedomFighters WHERE City = 'Porbandar'
UNION
SELECT Name FROM FreedomFighters WHERE City = 'Varanasi';
Output:
Name |
---|
Mahatma Gandhi |
Rani Lakshmi Bai |