---
title: "Remove/Delete duplicate values from table in SQL Server"  
description: "Remove/Delete duplicate values from table in SQL Server"  
author: "Anonymous User"  
published: 2013-05-16  
updated: 2013-05-16  
canonical: https://www.mindstick.com/forum/899/remove-delete-duplicate-values-from-table-in-sql-server  
category: "mssql server"  
tags: ["mssql server"]  
reading_time: 1 minute  

---

# Remove/Delete duplicate values from table in SQL Server

Hi Expert!\
I want to delete all [duplicate records](https://answers.mindstick.com/qa/116428/how-to-delete-duplicate-records-but-keep-one) in a table. My table as following \
[CREATE TABLE](https://www.mindstick.com/articles/443/how-to-create-table-in-sql-server) tblVisitor(S_No INT [IDENTITY](https://www.mindstick.com/articles/13090/icon-the-identity-of-your-brand) [PRIMARY KEY](https://www.mindstick.com/blog/214/primary-key),Visitor_ID INT,Visitor_Name VARCHAR(50),Visited_Date [DATETIME](https://www.mindstick.com/forum/12949/how-to-validate-if-a-datetime-field-is-not-null-empty) )\
Table with data\
S_No Visitor_ID Visitor_Name Visited Date\
1 101 er. samuel fernandes 2013-02-16 16:34:24.3072 102 hugh jackman 2013-03-06 16:34:24.3073 101 er. samuel fernandes 2013-03-11 16:34:45.1574 102 hugh jackman 2013-04-01 16:34:45.1575 101 er. samuel fernandes 2013-04-10 16:36:57.4236 102 hugh jackman 2013-04-18 16:36:57.4237 103 [brad pitt](https://yourviews.mindstick.com/view/87007/brad-pitt-biography-movies) 2013-04-28 16:36:57.4238 104 lois waisbrooker 2013-05-02 16:36:57.4239 105 ezra heywood 2013-05-13 16:36:57.42310 103 brad pitt 2013-05-16 16:36:57.423\
Now I want to [delete duplicate](https://www.mindstick.com/forum/34367/delete-duplicate-rows-in-sql) 'Visitor_ID' from tblVisitor \
Please help.Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!

## Replies

### Reply by AVADHESH PATEL

Hi Brad!\
**Try as following**\
**See [Duplicate](https://www.mindstick.com/forum/160911/sql-query-to-find-duplicate-records-in-a-table-in-sql-server) record**\
SELECT * FROM tblVisitor WHERE S_No NOT IN (SELECT MIN(S_No) FROM tblVisitor GROUP BY Visitor_ID) \
**Delete duplicate record**\
Delete tblVisitor WHERE S_No NOT IN (SELECT MIN(S_No) FROM tblVisitor GROUP BY Visitor_ID) \


---

Original Source: https://www.mindstick.com/forum/899/remove-delete-duplicate-values-from-table-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
