---
title: "How to select distinct data from Database?"  
description: "How to select distinct data from Database?"  
author: "Ethan Karla"  
published: 2021-09-14  
canonical: https://answers.mindstick.com/qa/93961/how-to-select-distinct-data-from-database  
category: "database"  
tags: ["database", "database management system"]  
reading_time: 1 minute  

---

# How to select distinct data from Database?

How to [select distinct](https://www.mindstick.com/forum/34065/how-to-find-select-distinct-address-in-entity-framework) [data from Database](https://www.mindstick.com/forum/34370/how-to-populate-google-charts-using-data-from-database-created-via-data-first-asp-dot-net-mvc)?

## Answers

### Answer by Ashutosh Kumar Verma

**[Select](https://www.mindstick.com/forum/34066/use-select-operator-in-linq) Distinct Statement-** **Select [Distinct data](https://www.mindstick.com/blog/384/distinct-data-in-sql-server) from table-** This SQL statement used to retrieve distinct(different) values. Sometimes a [database](https://www.mindstick.com/articles/100/windows-service-to-update-record-from-one-database-to-another-after-certain-interval-of-time) table contains many duplicated value and if we want to retrieve all duplicated values in single form then we can use this SQL statement. It returns all different values from table. **Syntax –** SELECT DISTINCT column1,column2,column3,…. FROM table_name ; **Example :** Lets have a Database table 'Orders'- ![How to select distinct data from Database?](https://answers.mindstick.com/questionanswer/d7d740ad-0f66-42b0-9c40-66fdfbc69aeb/images/732cdd37-c18c-4212-9803-903801c0b19e.png) **\** \
The following SQL Statement is select distinct OrderFrom from 'Orders' table. select distinct OrderFrom from Orders; ![How to select distinct data from Database?](https://answers.mindstick.com/questionanswer/d7d740ad-0f66-42b0-9c40-66fdfbc69aeb/images/62088464-57f7-4bd2-b765-4a1f81d5ae4f.png) Select multiple distinct columns from 'Orders' table. select distinct OrderName, OrderFrom ,Id from Orders; ![How to select distinct data from Database?](https://answers.mindstick.com/questionanswer/d7d740ad-0f66-42b0-9c40-66fdfbc69aeb/images/ea5e1dda-395f-4890-9702-f35b479cbce1.png)\
**The following SQL statement is lists the number of different Id in Orders table-** This statement will returns the number of different column data from database table. select count( distinct Id) from Orders; ![How to select distinct data from Database?](https://answers.mindstick.com/questionanswer/d7d740ad-0f66-42b0-9c40-66fdfbc69aeb/images/64e1540e-8714-46a8-9c65-e21c74504aa5.png)\


---

Original Source: https://answers.mindstick.com/qa/93961/how-to-select-distinct-data-from-database

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
