---
title: "what is union in sql server?"  
description: "what is union in sql server?"  
author: "Amit Singh"  
published: 2011-04-28  
updated: 2020-09-20  
canonical: https://www.mindstick.com/interview/797/what-is-union-in-sql-server  
category: "mssql server"  
tags: ["mssql server"]  
reading_time: 1 minute  

---

# what is union in sql server?

The UNION command is used to select related information from two tables, much like the JOIN command. However, when using the UNION command all selected columns need to be of the same data type. With UNION, only distinct values are selected.

## Answers

### Answer by Amit Singh

The UNION command is used to select related information from two tables, much like the JOIN command. However, when using the UNION command all selected columns need to be of the same data type. With UNION, only distinct values are selected.


---

Original Source: https://www.mindstick.com/interview/797/what-is-union-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
