Skip to main content

Posts

Showing posts from April, 2021

How to use SQL query to delete duplicate rows in SQL server management studio

How to use SQL query to delete duplicate rows In this tutorial SQL interview questions and answers. We will discuss how to use SQL query to delete duplicate rows except one from a SQL server table this is a very common interview question it is the table with duplicate data record notice that Markers record is duplicated three times pencil record three times and whitepaper are two times in the table. create table stationery( ID int, Product_name nvarchar(50), items_color nvarchar(50), prices int ) Go Now we delete the query that we are going to write should delete all the duplicate rows except one original record of stationery means after. we execute the delete query the stationery table should be left with just three records as you can see here let's see how to achieve this. Let's enter to the SQL server management studio 2018. so we have created a stationery table in SQL server management studio. and execute the script and test that can do it. In case you n...