---
title: "Select unique record from table"  
description: "Select unique record from table"  
author: "Mark Devid"  
published: 2013-01-07  
updated: 2013-01-07  
canonical: https://www.mindstick.com/forum/531/select-unique-record-from-table  
category: "mssql server"  
tags: ["mssql server"]  
reading_time: 1 minute  

---

# Select unique record from table

Hi every one\
\
I have a [table](https://www.mindstick.com/articles/43918/how-to-design-table-using-bootstrap) witch have [duplicate records](https://answers.mindstick.com/qa/116428/how-to-delete-duplicate-records-but-keep-one). I want to [select](https://www.mindstick.com/forum/160534/orderby-then-select-vs-select-then-orderby-performance) only [unique](https://www.mindstick.com/blog/12870/how-to-be-unique-in-business) record with how many time repeated [form](https://www.mindstick.com/forum/6/multi-form-mfc-application) table.\
**My table [structure](https://www.mindstick.com/articles/23258/choose-your-business-structure-wisely) as**\
\

```
CREATE TABLE [dbo].[EmpInfo](  [ID] INT IDENTITY PRIMARY KEY,  [EmpName] VARCHAR(100))INSERT INTO [dbo].[EmpInfo]  ([EmpName]) VALUES('Chris Roberts')INSERT INTO [dbo].[EmpInfo]  ([EmpName]) VALUES ('Brad Tutterow')INSERT INTO [dbo].[EmpInfo]  ([EmpName]) VALUES('Chris Roberts')INSERT INTO [dbo].[EmpInfo]  ([EmpName]) VALUES ('Brad Tutterow')INSERT INTO [dbo].[EmpInfo]  ([EmpName]) VALUES ('Paul Mendoza')INSERT INTO [dbo].[EmpInfo]  ([EmpName]) VALUES ('Zack Peterson')INSERT INTO [dbo].[EmpInfo]  ([EmpName]) VALUES ('Paul Mendoza')INSERT INTO [dbo].[EmpInfo]  ([EmpName]) VALUES ('Zack Peterson')INSERT INTO [dbo].[EmpInfo]  ([EmpName]) VALUES ('Vijay Shukla')
```

\
Thank in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)

## Replies

### Reply by AVADHESH PATEL

Hi Mark Devid,\
\
you can use below sql query\
\
SELECT [EmpName], COUNT(*) TotalCount FROM [dbo].[EmpInfo] GROUP BY [EmpName] HAVING COUNT(*) > 1 ORDER BY COUNT(*) DESC


---

Original Source: https://www.mindstick.com/forum/531/select-unique-record-from-table

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
