Are the ancient Hindu myths of a land bridge connecting India and Sri Lanka true? Scientific analysis suggests they are. #WhatonEarth pic.twitter.com/EKcoGzlEET— Science Channel (@ScienceChannel) 11 December 2017
Digital marketing,social,Dot net,telangana,information,helping, resume preparation,devotional,yoga,google adsense help
Wednesday, December 13, 2017
IS Ram Sethu is True ?
Monday, December 11, 2017
How to find duplicate records from sql server Table and Delete
How to find the duplicate record ?
Finding duplicate record from table using CTE.
WITH CTE
AS
(SELECT NAME,EMP_ID,ROW_NUMBER()
OVER(PARTITION BY NAME ORDER BY NAME)
AS NAMEDUP FROM EMPLOYEE)
SELECT * FROM CTE WHERE NAMEDUP > 1 ORDER BY NAME
Using Having Count
SELECT NAME,COUNT(NAME)FROM EMPLOYEE
GROUP BY NAME HAVING COUNT(*)>1
Using group by
SELECT NAME,COUNT(NAME) AS CNT
FROM EMPLOYEE
GROUP BY NAME
Deleting duplicate records from the table.
WITH CTE
AS
(SELECT NAME,EMP_ID,ROW_NUMBER()
OVER(PARTITION BY NAME ORDER BY NAME)
AS NAMEDUP FROM EMPLOYEE)
DELETE FROM CTE WHERE NAMEDUP > 1
Finding duplicate record from table using CTE.
WITH CTE
AS
(SELECT NAME,EMP_ID,ROW_NUMBER()
OVER(PARTITION BY NAME ORDER BY NAME)
AS NAMEDUP FROM EMPLOYEE)
SELECT * FROM CTE WHERE NAMEDUP > 1 ORDER BY NAME
Using Having Count
SELECT NAME,COUNT(NAME)FROM EMPLOYEE
GROUP BY NAME HAVING COUNT(*)>1
Using group by
SELECT NAME,COUNT(NAME) AS CNT
FROM EMPLOYEE
GROUP BY NAME
Deleting duplicate records from the table.
WITH CTE
AS
(SELECT NAME,EMP_ID,ROW_NUMBER()
OVER(PARTITION BY NAME ORDER BY NAME)
AS NAMEDUP FROM EMPLOYEE)
DELETE FROM CTE WHERE NAMEDUP > 1
Subscribe to:
Posts (Atom)
Blog Archive
-
▼
2025
(64)
-
▼
October
(18)
- 🧱 Understanding the Core Building Blocks of Angular
- 🧠 What is Generics in C#? Complete Guide with Exa...
- 🧩 Understanding Adapter Design Pattern in Softwar...
- Notification Flow in Microservices
- Background Service in Micro Services - Complete Guide
- 🔑 Where to Configure Ports in .NET Core
- 🔑 Example: Ocelot API Gateway with JWT Authentica...
- 🌐 API Gateway in Microservices
- 📢 Notifications in .NET Core with Web API, Azure ...
- ⚙️ SQL vs T-SQL vs PostgreSQL — Practical Code Com...
- 🧠 SQL vs T-SQL vs PostgreSQL — A Complete Guide f...
- 🌌 Azure Cosmos DB Explained: From Basics to Real-...
- Access Modifiers in C# — Complete Guide (with Real...
- 🚀 AI in .NET, .NET Core, Web API, and SQL Server ...
- 🚀 Understanding Middleware and Dependency Injecti...
- How Azure Kubernetes Service (AKS) works — and a s...
- Top Advantages of .NET Core Over .NET Framework | ...
- 🚀 What’s New in C#: Latest Features You Should Kn...
-
▼
October
(18)